in modules/fcgid/fcgid_pm_unix.c [423:459]
void procmgr_init_spawn_cmd(fcgid_command * command, request_rec * r,
fcgid_cmd_conf *cmd_conf)
{
ap_unix_identity_t *ugid;
fcgid_server_conf *sconf =
ap_get_module_config(r->server->module_config, &fcgid_module);
/* suEXEC check */
if ((ugid = ap_run_get_suexec_identity(r))) {
command->uid = ugid->uid;
command->gid = ugid->gid;
command->userdir = ugid->userdir;
} else {
command->uid = (uid_t) - 1;
command->gid = (gid_t) - 1;
command->userdir = 0;
}
/* no truncation should ever occur */
AP_DEBUG_ASSERT(sizeof command->cgipath > strlen(cmd_conf->cgipath));
apr_cpystrn(command->cgipath, cmd_conf->cgipath, sizeof command->cgipath);
AP_DEBUG_ASSERT(sizeof command->cmdline > strlen(cmd_conf->cmdline));
apr_cpystrn(command->cmdline, cmd_conf->cmdline, sizeof command->cmdline);
command->deviceid = cmd_conf->deviceid;
command->inode = cmd_conf->inode;
command->vhost_id = sconf->vhost_id;
if (r->server->server_hostname) {
apr_cpystrn(command->server_hostname, r->server->server_hostname,
sizeof command->server_hostname);
}
else {
command->server_hostname[0] = '\0';
}
get_cmd_options(r, command->cgipath, &command->cmdopts, &command->cmdenv);
}