MCPcopy Create free account
hub / github.com/apache/httpd / os_init_job_environment

Function os_init_job_environment

os/unix/unixd.c:676–695  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

674 * That is important if CGI scripts try to execute native BS2000 commands.
675 */
676int 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 */
698pid_t os_fork(const char *user)

Callers

nothing calls this directly

Calls 2

os_forktypeFunction · 0.70
ap_log_errorFunction · 0.50

Tested by

no test coverage detected