r2258: Attempt to fix Bug 1715. Not sure if all of ldapsam_compat works now, but...
authorVolker Lendecke <vlendec@samba.org>
Wed, 8 Sep 2004 18:30:00 +0000 (18:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:37 +0000 (10:52 -0500)
definitely fixes two segfaults.

Volker

source/lib/smbldap.c

index e66fb3640cfc6601290b981dc10feefeb8aa95fc..c4abc8cf1ab3fa9c18e3b05ce325de92fb308364 100644 (file)
@@ -66,6 +66,7 @@ ATTRIB_MAP_ENTRY attrib_map_v22[] = {
        { LDAP_ATTR_DOMAIN,             "domain"        },
        { LDAP_ATTR_OBJCLASS,           "objectClass"   },
        { LDAP_ATTR_ACB_INFO,           "acctFlags"     },
+       { LDAP_ATTR_MOD_TIMESTAMP,      "modifyTimestamp"       },
        { LDAP_ATTR_LIST_END,           NULL            }
 };
 
@@ -428,6 +429,12 @@ static BOOL fetch_ldap_pw(char **dn, char** pw)
        char oldval[2048]; /* current largest allowed value is mungeddial */
        BOOL existed;
 
+       if (attribute == NULL) {
+               /* This can actually happen for ldapsam_compat where we for
+                * example don't have a password history */
+               return;
+       }
+
        if (existing != NULL) {
                existed = smbldap_get_single_attribute(ldap_struct, existing, attribute, oldval, sizeof(oldval));
        } else {