httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@hyperreal.com>
Subject cvs commit: apache/src util_script.c
Date Fri, 25 Apr 1997 13:39:36 GMT
randy       97/04/25 06:39:35

  Modified:    src       util_script.c
  Log:
  Reverse previous changes.
  
  Revision  Changes    Path
  1.51      +8 -11     apache/src/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/util_script.c,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -C3 -r1.50 -r1.51
  *** util_script.c	1997/04/25 05:29:53	1.50
  --- util_script.c	1997/04/25 13:39:33	1.51
  ***************
  *** 433,443 ****
    void call_exec (request_rec *r, char *argv0, char **env, int shellcmd) 
    {
        char *execuser;
  -     char *grpname;
  -     char *useruri;
        core_dir_config *conf;
        struct passwd *pw;
        struct group *gr;
        
        conf = (core_dir_config *)get_module_config(r->per_dir_config, &core_module);
    
  --- 433,442 ----
    void call_exec (request_rec *r, char *argv0, char **env, int shellcmd) 
    {
        char *execuser;
        core_dir_config *conf;
        struct passwd *pw;
        struct group *gr;
  +     char *grpname;
        
        conf = (core_dir_config *)get_module_config(r->per_dir_config, &core_module);
    
  ***************
  *** 547,569 ****
    	  (!strncmp("/~", r->uri, 2))) ) {
    
            if (!strncmp("/~",r->uri,2)) {
  !             useruri = r->uri;
  !             useruri += 2;
  !             if ((pw = getpwnam (getword_nc (r->pool, &useruri, '/'))) == NULL)
{
    		log_unixerr("getpwnam", NULL, "invalid username", r->server);
    		return;
    	    }
  !             useruri -= 2;
                if ((gr = getgrgid (pw->pw_gid)) == NULL) {
    		if ((grpname = palloc (r->pool, 16)) == NULL) 
    		    return;
    		else
  ! 		    ap_snprintf(grpname, sizeof(grpname), "%d", pw->pw_gid);
    	    }
                else
    		grpname = gr->gr_name;
  ! 
  !             execuser = pstrcat (r->pool, "~", pw->pw_name, NULL);
            }
    	else {
    	    if ((pw = getpwuid (r->server->server_uid)) == NULL) {
  --- 546,567 ----
    	  (!strncmp("/~", r->uri, 2))) ) {
    
            if (!strncmp("/~",r->uri,2)) {
  !             r->uri += 2;
  !             if ((pw = getpwnam (getword_nc (r->pool, &r->uri, '/'))) == NULL)
{
    		log_unixerr("getpwnam", NULL, "invalid username", r->server);
    		return;
    	    }
  !             r->uri -= 2;
                if ((gr = getgrgid (pw->pw_gid)) == NULL) {
    		if ((grpname = palloc (r->pool, 16)) == NULL) 
    		    return;
    		else
  ! 		    ap_snprintf(grpname, sizeof(grpname), "%d\0", pw->pw_gid);
    	    }
                else
    		grpname = gr->gr_name;
  ! 	execuser = (char *) palloc (r->pool, (sizeof(pw->pw_name) + 1));
  ! 	execuser = pstrcat (r->pool, "~", pw->pw_name, NULL);
            }
    	else {
    	    if ((pw = getpwuid (r->server->server_uid)) == NULL) {
  ***************
  *** 574,581 ****
    		log_unixerr("getgrgid", NULL, "invalid groupid", r->server);
    		return;
    	    }
  ! 
  !             grpname = gr->gr_name;
                execuser = pw->pw_name;
            }
      
  --- 572,578 ----
    		log_unixerr("getgrgid", NULL, "invalid groupid", r->server);
    		return;
    	    }
  ! 	    execuser = (char *) palloc (r->pool, sizeof(pw->pw_name)); 
                execuser = pw->pw_name;
            }
      
  
  
  

Mime
View raw message