httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject SUEXEC warnings
Date Sun, 01 Dec 1996 02:00:44 GMT
Patch follows to add warnings when using User/Group in <VirtualHost>
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 <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;
  }
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... */




Mime
View raw message