From: Volker Lendecke Date: Wed, 8 Sep 2004 18:30:00 +0000 (+0000) Subject: r2258: Attempt to fix Bug 1715. Not sure if all of ldapsam_compat works now, but... X-Git-Tag: initial-v3-0-unstable~5821 X-Git-Url: http://git.samba.org/samba.git/?p=tprouty%2Fsamba.git;a=commitdiff_plain;h=270740189995c56c4d0341aeded364efffec86f2 r2258: Attempt to fix Bug 1715. Not sure if all of ldapsam_compat works now, but this definitely fixes two segfaults. Volker --- diff --git a/source/lib/smbldap.c b/source/lib/smbldap.c index e66fb3640c..c4abc8cf1a 100644 --- a/source/lib/smbldap.c +++ b/source/lib/smbldap.c @@ -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 {