Received: by taz.hyperreal.com (8.8.3/V2.0) id SAA01451; Sat, 30 Nov 1996 18:00:39 -0800 (PST) Received: from sierra.zyzzyva.com by taz.hyperreal.com (8.8.3/V2.0) with ESMTP id SAA01441; Sat, 30 Nov 1996 18:00:33 -0800 (PST) Received: from sierra.zyzzyva.com (localhost [127.0.0.1]) by sierra.zyzzyva.com (8.8.2/8.8.2) with ESMTP id UAA05265 for ; Sat, 30 Nov 1996 20:00:45 -0600 (CST) Message-Id: <199612010200.UAA05265@sierra.zyzzyva.com> To: new-httpd@apache.org Subject: SUEXEC warnings X-uri: http://www.zyzzyva.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 30 Nov 1996 20:00:44 -0600 From: Randy Terbush Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com Patch follows to add warnings when using User/Group in when a wrapper is not properly configured. A few quick +1s and I'll commit this. Index: src/http_core.c =================================================================== RCS file: /export/home/cvs/apache/src/http_core.c,v retrieving revision 1.49 diff -c -r1.49 http_core.c *** http_core.c 1996/11/18 19:40:46 1.49 --- http_core.c 1996/12/01 01:47:02 *************** *** 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 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 requires SUEXEC wrapper.\n"); ! } ! } return NULL; } Index: src/http_main.c =================================================================== RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.90 diff -c -r1.90 http_main.c *** http_main.c 1996/11/26 20:11:44 1.90 --- http_main.c 1996/12/01 01:47:25 *************** *** 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... */