This routine complements the setuid() call: it causes the BS2000 job * environment to be switched to the target user's user id. * That is important if CGI scripts try to execute native BS2000 commands. */
| 674 | * That is important if CGI scripts try to execute native BS2000 commands. |
| 675 | */ |
| 676 | int os_init_job_environment(server_rec *server, const char *user_name, int one_process) |
| 677 | { |
| 678 | bs2_ForkType type = os_forktype(one_process); |
| 679 | |
| 680 | /* We can be sure that no change to uid==0 is possible because of |
| 681 | * the checks in http_core.c:set_user() |
| 682 | */ |
| 683 | |
| 684 | if (one_process) { |
| 685 | |
| 686 | type = forktype = bs2_noFORK; |
| 687 | |
| 688 | ap_log_error(APLOG_MARK, APLOG_ERR, 0, server, APLOGNO(02180) |
| 689 | "The debug mode of Apache should only " |
| 690 | "be started by an unprivileged user!"); |
| 691 | return 0; |
| 692 | } |
| 693 | |
| 694 | return 0; |
| 695 | } |
| 696 | |
| 697 | /* BS2000 requires a "special" version of fork() before a setuid() call */ |
| 698 | pid_t os_fork(const char *user) |
nothing calls this directly
no test coverage detected