You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@hyperreal.org on 1999/02/16 14:41:01 UTC

cvs commit: apache-1.3/src/support suexec.c

martin      99/02/16 05:41:01

  Modified:    src/support suexec.c
  Log:
  Initialize Job Environment on BS2000
  (not relevant for any other platform)
  
  Revision  Changes    Path
  1.49      +27 -0     apache-1.3/src/support/suexec.c
  
  Index: suexec.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/support/suexec.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- suexec.c	1999/01/01 19:05:35	1.48
  +++ suexec.c	1999/02/16 13:41:00	1.49
  @@ -341,6 +341,33 @@
   	actual_gname = strdup(target_gname);
       }
   
  +#ifdef _OSD_POSIX
  +    /*
  +     * Initialize BS2000 user environment
  +     */
  +    {
  +	pid_t pid;
  +	int status;
  +
  +	switch (pid = ufork(target_uname))
  +	{
  +	case -1:	/* Error */
  +	    log_err("failed to setup bs2000 environment for user %s: %s\n",
  +		    target_uname, strerror(errno));
  +	    exit(150);
  +	case 0:	/* Child */
  +	    break;
  +	default:	/* Father */
  +	    while (pid != waitpid(pid, &status, 0))
  +		;
  +	    /* @@@ FIXME: should we deal with STOP signals as well? */
  +	    if (WIFSIGNALED(status))
  +		kill (getpid(), WTERMSIG(status));
  +	    exit(WEXITSTATUS(status));
  +	}
  +    }
  +#endif /*_OSD_POSIX*/
  +
       /*
        * Save these for later since initgroups will hose the struct
        */