PeruserAttachments: peruser-0.3-compat.patch
| File peruser-0.3-compat.patch, 2.6 KB (added by lazy, 3 years ago) |
|---|
-
server/mpm/experimental/peruser/peruser.c
3457 3457 return NULL; 3458 3458 } 3459 3459 3460 3461 void senv_init(server_env_t * senv) { 3462 3463 senv->nice_lvl = 0; 3464 senv->chroot = NULL; 3465 senv->cgroup = NULL; 3466 senv->min_processors = ap_min_processors; 3467 senv->min_free_processors = ap_min_free_processors; 3468 senv->max_free_processors = ap_max_free_processors; 3469 senv->max_processors = ap_max_processors; 3470 } 3471 3460 3472 static const char* cf_ServerEnvironment(cmd_parms *cmd, void *dummy, 3461 const char *name )3473 const char *name, const char * group_name, const char * chroot) 3462 3474 { 3463 3475 peruser_server_conf *sconf = PERUSER_SERVER_CONF(cmd->server->module_config); 3464 3476 server_env_t senv; 3477 char * processor_name, *tmp; 3478 3465 3479 _DBG("function entered", 0); 3480 3481 /* name of processor env */ 3482 processor_name = name; 3483 3484 if(group_name != NULL || chroot != NULL) { 3485 /* deprecated ServerEnvironment user group chroot syntax 3486 * we create simple server env based on user/group/chroot only 3487 */ 3488 processor_name = apr_pstrcat(cmd->pool, name, "_",group_name, "_", chroot, NULL); 3489 3490 /* search for previous default server env */ 3491 sconf->senv = find_senv_by_name(processor_name); 3492 3493 if(!sconf->senv) { 3494 senv_init(&senv); 3495 senv.uid = ap_uname2id(name); 3496 senv.gid = ap_gname2id(group_name); 3497 senv.chroot = chroot; 3498 senv.name = processor_name; 3499 3500 tmp = child_add(CHILD_TYPE_PROCESSOR, CHILD_STATUS_STANDBY, cmd->pool, &senv); 3501 /* error handling in case this child can't be created */ 3502 if(tmp) 3503 return tmp; 3504 } 3505 } 3466 3506 3467 sconf->senv = find_senv_by_name(name); 3507 /* use predefined processor environment or default named "user_group_chroot" */ 3508 if(sconf->senv == NULL) 3509 sconf->senv = find_senv_by_name(processor_name); 3468 3510 3469 3511 if (sconf->senv == NULL) { 3470 3512 return apr_psprintf(cmd->pool, … … 3816 3858 "Specify an Multiplexer Child configuration."), 3817 3859 AP_INIT_RAW_ARGS("<Processor", cf_Processor, NULL, RSRC_CONF, 3818 3860 "Specify settings for processor."), 3819 AP_INIT_TAKE1 ("ServerEnvironment", cf_ServerEnvironment, NULL, RSRC_CONF,3861 AP_INIT_TAKE123("ServerEnvironment", cf_ServerEnvironment, NULL, RSRC_CONF, 3820 3862 "Specify the server environment for this virtual host."), 3821 3863 AP_INIT_TAKE1("MultiplexerChroot", cf_MultiplexerChroot, NULL, RSRC_CONF, 3822 3864 "Specify the multiplexer chroot path for multiplexer"),
