Commit fd3f347d authored by Andre Malo's avatar Andre Malo
Browse files

htpasswd should not refuse to process files containing empty lines.

Reviewed by: Jeff Trawick, Brad Nicholes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103789 13f79535-47bb-0310-9956-ffa450edef68
parent edf765f3
Loading
Loading
Loading
Loading
+3 −0
Changes for CHANGES: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
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 −5
Changes for STATUS: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
APACHE 2.0 STATUS:                                              -*-text-*-
Last modified at [$Date: 2004/05/26 23:03:12 $]
Last modified at [$Date: 2004/05/26 23:14:03 $]

Release:

@@ -127,10 +127,6 @@ PATCHES TO BACKPORT FROM 2.1
         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
+8 −3
Changes for support/htpasswd.c: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ int main(int argc, const char * const argv[])
    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 @@ int main(int argc, const char * const argv[])
        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.
             */