randy 96/12/01 08:09:42
Modified: src http_core.c http_main.c Log: Print a warning when User/Group is used in <VirtualHost> without a properly configured SUEXEC. Reviewed by: Chuck Murcko, Brian Behlendorf, Roy Fielding Revision Changes Path 1.50 +20 -14 apache/src/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache/src/http_core.c,v retrieving revision 1.49 retrieving revision 1.50 diff -C3 -r1.49 -r1.50 *** http_core.c 1996/11/18 19:40:46 1.49 --- http_core.c 1996/12/01 16:09:39 1.50 *************** *** 839,868 **** const char *set_user (cmd_parms *cmd, void *dummy, char *arg) { - uid_t uid; - - uid = uname2id (arg); - if (!cmd->server->is_virtual) { user_name = pstrdup (cmd->pool, arg); ! user_id = uid; } - - cmd->server->server_uid = uid; return NULL; } const char *set_group (cmd_parms *cmd, void *dummy, char *arg) { - gid_t gid; - - gid = gname2id(arg); - if (!cmd->server->is_virtual) ! group_id = gid; ! ! cmd->server->server_gid = gid; return NULL; } --- 839,874 ---- const char *set_user (cmd_parms *cmd, void *dummy, char *arg) { if (!cmd->server->is_virtual) { user_name = pstrdup (cmd->pool, arg); ! user_id = uname2id(arg); ! } ! else { ! if (suexec_enabled) ! cmd->server->server_uid = uname2id(arg); ! else { ! cmd->server->server_uid = user_id; ! fprintf(stderr, ! "Warning: User directive in <VirtualHost> requires SUEXEC wrapper.\n"); ! } } return NULL; } const char *set_group (cmd_parms *cmd, void *dummy, char *arg) { if (!cmd->server->is_virtual) ! group_id = gname2id(arg); ! else { ! if (suexec_enabled) ! cmd->server->server_gid = gname2id(arg); ! else { ! cmd->server->server_gid = group_id; ! fprintf(stderr, ! "Warning: Group directive in <VirtualHost> requires SUEXEC wrapper.\n"); ! } ! } return NULL; } 1.91 +1 -1 apache/src/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.90 retrieving revision 1.91 diff -C3 -r1.90 -r1.91 *** http_main.c 1996/11/26 20:11:44 1.90 --- http_main.c 1996/12/01 16:09:40 1.91 *************** *** 1960,1967 **** setup_prelinked_modules(); - server_conf = read_config (pconf, ptrans, server_confname); suexec_enabled = init_suexec(); if(standalone) { clear_pool (pconf); /* standalone_main rereads... */ --- 1960,1967 ---- setup_prelinked_modules(); suexec_enabled = init_suexec(); + server_conf = read_config (pconf, ptrans, server_confname); if(standalone) { clear_pool (pconf); /* standalone_main rereads... */