Changeset 1517

Show
Ignore:
Timestamp:
01/14/2007 09:46:33 AM (21 months ago)
Author:
darix
Message:

- allow empty passwords with ldap.

patch by Jöerg Sonnenberger

Location:
trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/http_auth.c

    r1495 r1517  
    736736                } 
    737737 
    738  
     738                if (p->conf.auth_ldap_allow_empty_pw != 1 && pw[0] == '\0') 
     739                        return -1; 
    739740 
    740741                /* build filter */ 
  • trunk/src/http_auth.h

    r1349 r1517  
    3737        buffer *auth_ldap_cafile; 
    3838        unsigned short auth_ldap_starttls; 
     39        unsigned short auth_ldap_allow_empty_pw; 
    3940 
    4041        unsigned short auth_debug; 
  • trunk/src/mod_auth.c

    r1496 r1517  
    116116        PATCH_OPTION(auth_ldap_cafile); 
    117117        PATCH_OPTION(auth_ldap_starttls); 
     118        PATCH_OPTION(auth_ldap_allow_empty_pw); 
    118119#ifdef USE_LDAP 
    119120        PATCH_OPTION(ldap); 
     
    163164                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.starttls"))) { 
    164165                                PATCH_OPTION(auth_ldap_starttls); 
     166                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("auth.backend.ldap.allow-empty-pw"))) { 
     167                                PATCH_OPTION(auth_ldap_allow_empty_pw); 
    165168                        } 
    166169                } 
     
    314317                { "auth.backend.ldap.bind-dn",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, 
    315318                { "auth.backend.ldap.bind-pw",      NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 10 */ 
     319                { "auth.backend.ldap.allow-empty-pw",     NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, 
    316320                { "auth.backend.htdigest.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, 
    317321                { "auth.backend.htpasswd.userfile", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, 
     
    361365                cv[7].destination = s->auth_ldap_cafile; 
    362366                cv[8].destination = &(s->auth_ldap_starttls); 
    363                 cv[9].destination = s->auth_ldap_binddn; 
    364                 cv[10].destination = s->auth_ldap_bindpw; 
    365                 cv[11].destination = s->auth_htdigest_userfile; 
    366                 cv[12].destination = s->auth_htpasswd_userfile; 
    367                 cv[13].destination = &(s->auth_debug); 
     367                cv[9].destination = s->auth_ldap_binddn; 
     368                cv[10].destination = s->auth_ldap_bindpw; 
     369                cv[11].destination = &(s->auth_ldap_allow_empty_pw); 
     370                cv[12].destination = s->auth_htdigest_userfile; 
     371                cv[13].destination = s->auth_htpasswd_userfile; 
     372                cv[14].destination = &(s->auth_debug); 
    368373 
    369374                p->config_storage[i] = s;