httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: apache-1.3/src/support suexec.c suexec.8
Date Thu, 08 Mar 2001 18:12:13 GMT
coar        01/03/08 10:12:08

  Modified:    src      CHANGES
               src/support suexec.c suexec.8
  Log:
  	Add -V option to suexec, to list compile-time settings with
  	which it was built.  Only usable by root and the HTTPD_USER.
  
  Revision  Changes    Path
  1.1663    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1662
  retrieving revision 1.1663
  diff -u -u -r1.1662 -r1.1663
  --- CHANGES	2001/02/27 06:39:31	1.1662
  +++ CHANGES	2001/03/08 18:11:20	1.1663
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.20
   
  +  *) Add a -V flag to suexec, which causes it to display the
  +     compile-time settings with which it was built.  (Only
  +     usable by root or the HTTPD_USER username.)  [Ken Coar]
  +
     *) Set the Win32 service description in the Services control panel to 
        the server_version string from Apache and the loaded modules.
        [William Rowe]
  
  
  
  1.56      +50 -11    apache-1.3/src/support/suexec.c
  
  Index: suexec.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/suexec.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -u -r1.55 -r1.56
  --- suexec.c	2001/01/15 17:06:40	1.55
  +++ suexec.c	2001/03/08 18:11:43	1.56
  @@ -268,11 +268,60 @@
       struct stat dir_info;	/* directory info holder     */
       struct stat prg_info;	/* program info holder       */
   
  +    prog = argv[0];
  +    /*
  +     * Check existence/validity of the UID of the user
  +     * running this program.  Error out if invalid.
  +     */
  +    uid = getuid();
  +    if ((pw = getpwuid(uid)) == NULL) {
  +	log_err("crit: invalid uid: (%ld)\n", uid);
  +	exit(102);
  +    }
       /*
  +     * See if this is a 'how were you compiled' request, and
  +     * comply if so.
  +     */
  +    if ((argc > 1)
  +        && (! strcmp(argv[1], "-V"))
  +        && ((uid == 0)
  +#ifdef _OSD_POSIX
  +        /* User name comparisons are case insensitive on BS2000/OSD */
  +            || (! strcasecmp(HTTPD_USER, pw->pw_name)))
  +#else  /* _OSD_POSIX */
  +            || (! strcmp(HTTPD_USER, pw->pw_name)))
  +#endif /* _OSD_POSIX */
  +        ) {
  +#ifdef DOC_ROOT
  +        fprintf(stderr, " -D DOC_ROOT=\"%s\"\n", DOC_ROOT);
  +#endif
  +#ifdef GID_MIN
  +        fprintf(stderr, " -D GID_MID=%d\n", GID_MIN);
  +#endif
  +#ifdef HTTPD_USER
  +        fprintf(stderr, " -D HTTPD_USER=\"%s\"\n", HTTPD_USER);
  +#endif
  +#ifdef LOG_EXEC
  +        fprintf(stderr, " -D LOG_EXEC=\"%s\"\n", LOG_EXEC);
  +#endif
  +#ifdef SAFE_PATH
  +        fprintf(stderr, " -D SAFE_PATH=\"%s\"\n", SAFE_PATH);
  +#endif
  +#ifdef SUEXEC_UMASK
  +        fprintf(stderr, " -D SUEXEC_UMASK=%03o\n", SUEXEC_UMASK);
  +#endif
  +#ifdef UID_MIN
  +        fprintf(stderr, " -D UID_MID=%d\n", UID_MIN);
  +#endif
  +#ifdef USERDIR_SUFFIX
  +        fprintf(stderr, " -D USERDIR_SUFFIX=\"%s\"\n", USERDIR_SUFFIX);
  +#endif
  +        exit(0);
  +    }
  +    /*
        * If there are a proper number of arguments, set
        * all of them to variables.  Otherwise, error out.
        */
  -    prog = argv[0];
       if (argc < 4) {
   	log_err("alert: too few arguments\n");
   	exit(101);
  @@ -280,16 +329,6 @@
       target_uname = argv[1];
       target_gname = argv[2];
       cmd = argv[3];
  -
  -    /*
  -     * Check existence/validity of the UID of the user
  -     * running this program.  Error out if invalid.
  -     */
  -    uid = getuid();
  -    if ((pw = getpwuid(uid)) == NULL) {
  -	log_err("crit: invalid uid: (%ld)\n", uid);
  -	exit(102);
  -    }
   
       /*
        * Check to see if the user running this program
  
  
  
  1.8       +15 -9     apache-1.3/src/support/suexec.8
  
  Index: suexec.8
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/suexec.8,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -u -r1.7 -r1.8
  --- suexec.8	2001/03/02 07:42:36	1.7
  +++ suexec.8	2001/03/08 18:11:48	1.8
  @@ -1,4 +1,4 @@
  -.TH suexec 8 "March 1998"
  +.TH suexec 8 "March 2001"
   .\" ====================================================================
   .\" The Apache Software License, Version 1.1
   .\"
  @@ -59,17 +59,23 @@
   .SH NAME
   suexec \- Switch User For Exec
   .SH SYNOPSIS
  -No synopsis for usage, because this program
  -is used internally by Apache only. 
  +.B suexec -V
   .PP
  +No other synopsis for usage, because this program
  +is otherwise only used internally by the Apache HTTP server. 
  +.PP
   .SH DESCRIPTION
   .B suexec
  -is the "wrapper" support program for the suEXEC behaviour for Apache.
  -It is run from within Apache automatically to switch the user when
  -an external program has to be run under a different user. For more
  -information about suEXEC see the document `Apache suEXEC Support'
  -under http://httpd.apache.org/docs/suexec.html .
  +is the "wrapper" support program for the suexec behaviour for the
  +Apache HTTP server.  It is run from within the server automatically
  +to switch the user when an external program has to be run under a
  +different user. For more information about suexec, see the online
  +document `Apache suexec Support' on the HTTP server project's
  +Web site at  http://httpd.apache.org/docs/suexec.html .
  +.SH OPTIONS
  +.IP -V
  +Display the list of compile-time settings used when \fBsuexec\fP
  +was built.  No other action is taken.
   .PD
   .SH SEE ALSO
   .BR httpd(8)
  -.
  
  
  

Mime
View raw message