Changeset 1938

Show
Ignore:
Timestamp:
08/17/2007 10:37:47 PM (13 months ago)
Author:
jan
Message:

removed early checks if the userfiles exist (fixes #1188)

- it is enough if the files exist when we really need them

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/src/mod_auth.c

    r1516 r1938  
    504504 
    505505                switch(s->auth_backend) { 
    506                 case AUTH_BACKEND_PLAIN: 
    507                         if (s->auth_plain_userfile->used) { 
    508                                 int fd; 
    509                                 /* try to read */ 
    510                                 if (-1 == (fd = open(s->auth_plain_userfile->ptr, O_RDONLY))) { 
    511                                         log_error_write(srv, __FILE__, __LINE__, "sbss", 
    512                                                         "opening auth.backend.plain.userfile:", s->auth_plain_userfile, 
    513                                                         "failed:", strerror(errno)); 
    514                                         return HANDLER_ERROR; 
    515                                 } 
    516                                 close(fd); 
    517                         } 
    518                         break; 
    519                 case AUTH_BACKEND_HTPASSWD: 
    520                         if (s->auth_htpasswd_userfile->used) { 
    521                                 int fd; 
    522                                 /* try to read */ 
    523                                 if (-1 == (fd = open(s->auth_htpasswd_userfile->ptr, O_RDONLY))) { 
    524                                         log_error_write(srv, __FILE__, __LINE__, "sbss", 
    525                                                         "opening auth.backend.htpasswd.userfile:", s->auth_htpasswd_userfile, 
    526                                                         "failed:", strerror(errno)); 
    527                                         return HANDLER_ERROR; 
    528                                 } 
    529                                 close(fd); 
    530                         } 
    531                         break; 
    532                 case AUTH_BACKEND_HTDIGEST: 
    533                         if (s->auth_htdigest_userfile->used) { 
    534                                 int fd; 
    535                                 /* try to read */ 
    536                                 if (-1 == (fd = open(s->auth_htdigest_userfile->ptr, O_RDONLY))) { 
    537                                         log_error_write(srv, __FILE__, __LINE__, "sbss", 
    538                                                         "opening auth.backend.htdigest.userfile:", s->auth_htdigest_userfile, 
    539                                                         "failed:", strerror(errno)); 
    540                                         return HANDLER_ERROR; 
    541                                 } 
    542                                 close(fd); 
    543                         } 
    544                         break; 
    545506                case AUTH_BACKEND_LDAP: { 
    546507                        handler_t ret = auth_ldap_init(srv, s);