You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2004/05/27 01:14:04 UTC

cvs commit: httpd-2.0/support htpasswd.c

nd          2004/05/26 16:14:04

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               support  Tag: APACHE_2_0_BRANCH htpasswd.c
  Log:
  htpasswd should not refuse to process files containing empty lines.
  
  Reviewed by: Jeff Trawick, Brad Nicholes
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.288 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.287
  retrieving revision 1.988.2.288
  diff -u -u -r1.988.2.287 -r1.988.2.288
  --- CHANGES	26 May 2004 23:03:12 -0000	1.988.2.287
  +++ CHANGES	26 May 2004 23:14:02 -0000	1.988.2.288
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.50
   
  +  *) htpasswd no longer refuses to process files that contain empty
  +     lines.  [Andr� Malo]
  +
     *) Regression from 1.3: At startup, suexec now will be checked for
        availability, the setuid bit and user root. The works only if
        httpd is compiled with the shipped APR version (0.9.5).
  
  
  
  1.751.2.890 +1 -5      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.889
  retrieving revision 1.751.2.890
  diff -u -u -r1.751.2.889 -r1.751.2.890
  --- STATUS	26 May 2004 23:03:12 -0000	1.751.2.889
  +++ STATUS	26 May 2004 23:14:03 -0000	1.751.2.890
  @@ -127,10 +127,6 @@
            modules/mappers/mod_actions.c: r1.32, r1.34
          +1: nd
   
  -    *) htpasswd should not refuse to process files containing empty lines.
  -         support/htpasswd.c: r1.76
  -       +1: nd, trawick, bnicholes
  -
       *) Disable AcceptEx on Win9x systems automatically. (broken in 2.0.49)
          PR 28529
            server/mpm/winnt/mpm_winnt.c: 1.311
  
  
  
  No                   revision
  No                   revision
  1.67.2.8  +8 -3      httpd-2.0/support/htpasswd.c
  
  Index: htpasswd.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/htpasswd.c,v
  retrieving revision 1.67.2.7
  retrieving revision 1.67.2.8
  diff -u -u -r1.67.2.7 -r1.67.2.8
  --- htpasswd.c	29 Mar 2004 23:51:44 -0000	1.67.2.7
  +++ htpasswd.c	26 May 2004 23:14:04 -0000	1.67.2.8
  @@ -394,7 +394,7 @@
       char *user = NULL;
       char tn[] = "htpasswd.tmp.XXXXXX";
       char *dirname;
  -    char scratch[MAX_STRING_LEN];
  +    char *scratch, cp[MAX_STRING_LEN];
       int found = 0;
       int i;
       int alg = ALG_CRYPT;
  @@ -533,11 +533,16 @@
           while (apr_file_gets(line, sizeof(line), fpw) == APR_SUCCESS) {
               char *colon;
   
  -            if ((line[0] == '#') || (line[0] == '\0')) {
  +            strcpy(cp, line);
  +            scratch = cp;
  +            while (apr_isspace(*scratch)) {
  +                ++scratch;
  +            }
  +
  +            if (!*scratch || (*scratch == '#')) {
                   putline(ftemp, line);
                   continue;
               }
  -            strcpy(scratch, line);
               /*
                * See if this is our user.
                */