summaryrefslogtreecommitdiff
path: root/source3/lib/smbldap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-07-07 22:46:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:09 -0500
commit1c5867502a47371e24519ffeb4165c69cab63482 (patch)
treecb02e1b714da10cbdfede8ec23b0c19b266bd7f4 /source3/lib/smbldap.c
parentb42a10a8ef770b5d26fa703482ab477ad082fd16 (diff)
downloadsamba-1c5867502a47371e24519ffeb4165c69cab63482.tar.gz
samba-1c5867502a47371e24519ffeb4165c69cab63482.tar.bz2
samba-1c5867502a47371e24519ffeb4165c69cab63482.zip
r1388: Adding password history code for ldap backend, based on a patch from
"Jianliang Lu" <j.lu@tiesse.com>. Multi-string attribute changed to linearised pstring due to ordering issues. A few other changes to fix race conditions. I will add the tdb backend code next. This code compiles but has not yet been tested with password history policy set to greater than zero. Targeted for 3.0.6. Jeremy. (This used to be commit dd54b2a3c45e202e504ad69d170eb798da4e6fc9)
Diffstat (limited to 'source3/lib/smbldap.c')
-rw-r--r--source3/lib/smbldap.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index d058613f00..9b6d597606 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -100,6 +100,8 @@ ATTRIB_MAP_ENTRY attrib_map_v30[] = {
{ LDAP_ATTR_MUNGED_DIAL, "sambaMungedDial" },
{ LDAP_ATTR_BAD_PASSWORD_COUNT, "sambaBadPasswordCount" },
{ LDAP_ATTR_BAD_PASSWORD_TIME, "sambaBadPasswordTime" },
+ { LDAP_ATTR_PWD_HISTORY, "sambaPasswordHistory" },
+ { LDAP_ATTR_MOD_TIMESTAMP, "modifyTimestamp" },
{ LDAP_ATTR_LIST_END, NULL }
};
@@ -345,19 +347,19 @@ static BOOL fetch_ldap_pw(char **dn, char** pw)
/* sanity checks on the mod values */
- if (attribute == NULL || *attribute == '\0')
+ if (attribute == NULL || *attribute == '\0') {
return;
+ }
+
#if 0 /* commented out after discussion with abartlet. Do not reenable.
left here so other so re-add similar code --jerry */
if (value == NULL || *value == '\0')
return;
#endif
- if (mods == NULL)
- {
+ if (mods == NULL) {
mods = (LDAPMod **) malloc(sizeof(LDAPMod *));
- if (mods == NULL)
- {
+ if (mods == NULL) {
DEBUG(0, ("make_a_mod: out of memory!\n"));
return;
}
@@ -369,17 +371,14 @@ static BOOL fetch_ldap_pw(char **dn, char** pw)
break;
}
- if (mods[i] == NULL)
- {
+ if (mods[i] == NULL) {
mods = (LDAPMod **) Realloc (mods, (i + 2) * sizeof (LDAPMod *));
- if (mods == NULL)
- {
+ if (mods == NULL) {
DEBUG(0, ("make_a_mod: out of memory!\n"));
return;
}
mods[i] = (LDAPMod *) malloc(sizeof(LDAPMod));
- if (mods[i] == NULL)
- {
+ if (mods[i] == NULL) {
DEBUG(0, ("make_a_mod: out of memory!\n"));
return;
}
@@ -389,8 +388,7 @@ static BOOL fetch_ldap_pw(char **dn, char** pw)
mods[i + 1] = NULL;
}
- if (value != NULL)
- {
+ if (value != NULL) {
char *utf8_value = NULL;
j = 0;