* LDAP auth - do not permit empty passwords
authorArt Cancro <ajc@citadel.org>
Tue, 22 Jun 2010 21:12:21 +0000 (21:12 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 22 Jun 2010 21:12:21 +0000 (21:12 +0000)
citadel/ldap.c

index 2e293276e3734a54b22b0b5b291b47255ca80e29..19625454605246c51bd8fb85cf2f7e1e1cd7ede2 100644 (file)
@@ -228,6 +228,11 @@ int CtdlTryPasswordLDAP(char *user_dn, const char *password)
        LDAP *ldserver = NULL;
        int i = (-1);
 
+       if (IsEmptyStr(password)) {
+               CtdlLogPrintf(CTDL_DEBUG, "LDAP: empty passwords are not permitted\n");
+               return(1);
+       }
+
        CtdlLogPrintf(CTDL_DEBUG, "LDAP: trying to bind as %s\n", user_dn);
        ldserver = ldap_init(config.c_ldap_host, config.c_ldap_port);
        if (ldserver) {