BS2000 requires a "special" version of fork() before a setuid() call */
| 696 | |
| 697 | /* BS2000 requires a "special" version of fork() before a setuid() call */ |
| 698 | pid_t os_fork(const char *user) |
| 699 | { |
| 700 | pid_t pid; |
| 701 | char username[USER_LEN+1]; |
| 702 | |
| 703 | switch (os_forktype(0)) { |
| 704 | |
| 705 | case bs2_FORK: |
| 706 | pid = fork(); |
| 707 | break; |
| 708 | |
| 709 | case bs2_UFORK: |
| 710 | apr_cpystrn(username, user, sizeof username); |
| 711 | |
| 712 | /* Make user name all upper case - for some versions of ufork() */ |
| 713 | ap_str_toupper(username); |
| 714 | |
| 715 | pid = ufork(username); |
| 716 | if (pid == -1 && errno == EPERM) { |
| 717 | ap_log_error(APLOG_MARK, APLOG_EMERG, errno, ap_server_conf, |
| 718 | APLOGNO(02181) "ufork: Possible mis-configuration " |
| 719 | "for user %s - Aborting.", user); |
| 720 | exit(1); |
| 721 | } |
| 722 | break; |
| 723 | |
| 724 | default: |
| 725 | pid = 0; |
| 726 | break; |
| 727 | } |
| 728 | |
| 729 | return pid; |
| 730 | } |
| 731 | |
| 732 | #endif /* _OSD_POSIX */ |
| 733 |
nothing calls this directly
no test coverage detected