httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c
Date Thu, 29 Nov 2001 06:56:09 GMT
wrowe       01/11/28 22:56:09

  Modified:    .        CHANGES
               server/mpm/winnt mpm_winnt.c
  Log:
    Prevent Apache from continuing to start when it's encountered a parsing
    error in the Win32 mpm's argv[] review.
  
    Reported by Grif Rosser <grifr@covalent.net>
  
  Revision  Changes    Path
  1.461     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.460
  retrieving revision 1.461
  diff -u -r1.460 -r1.461
  --- CHANGES	2001/11/28 21:07:31	1.460
  +++ CHANGES	2001/11/29 06:56:08	1.461
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.30-dev
   
  +  *) Prevent the Win32 port from continuing after encountering an
  +     error in the command line args to apache.  [William Rowe]
  +
     *) On a error in the proxy, make it write a line to the error log
        [Ian Holsman]
   
  
  
  
  1.200     +13 -2     httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.199
  retrieving revision 1.200
  diff -u -r1.199 -r1.200
  --- mpm_winnt.c	2001/11/23 23:49:24	1.199
  +++ mpm_winnt.c	2001/11/29 06:56:09	1.200
  @@ -1691,8 +1691,9 @@
       optbuf[0] = '-';
       optbuf[2] = '\0';
       apr_getopt_init(&opt, process->pool, process->argc, (char**) process->argv);
  -    while (apr_getopt(opt, "n:k:iu" AP_SERVER_BASEARGS, 
  -                      optbuf + 1, &optarg) == APR_SUCCESS) {
  +    opt->errfn = NULL;
  +    while ((rv = apr_getopt(opt, "n:k:iu" AP_SERVER_BASEARGS, 
  +                            optbuf + 1, &optarg)) == APR_SUCCESS) {
           switch (optbuf[1]) {
           case 'n':
               service_set = mpm_service_set_name(process->pool, &service_name, 
  @@ -1722,6 +1723,16 @@
           }
       }
       
  +    /* back up to capture the bad argument */
  +    if (rv == APR_BADCH || rv == APR_BADARG) {
  +        opt->ind--;
  +    }
  +
  +    while (opt->ind < opt->argc) {
  +        *(const char **)apr_array_push(mpm_new_argv) =
  +            apr_pstrdup(process->pool, opt->argv[opt->ind++]);
  +    }
  +
       /* Track the number of args actually entered by the user */
       inst_argc = mpm_new_argv->nelts - fixed_args;
   
  
  
  

Mime
View raw message