Author: gd Date: 2004-10-04 15:53:33 +0000 (Mon, 04 Oct 2004) New Revision: 2819
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=2819&nolog=1 Log: Make 'password history'-behaviour in ldapsam more consistent. Currently we cannot store more then 15 password history entries (windows NT4 allows to store 24) in ldapsam. When choosing more then "15" with pdbedit -P "password history", we fail to initialize the password history upon password change and overwrite the history, effectively using a password history of "1". We do already decrease any history-policy larger then 15 to 15 while storing the password history list attribute in ldap. Guenther Modified: branches/SAMBA_3_0/source/passdb/pdb_ldap.c trunk/source/passdb/pdb_ldap.c Changeset: Modified: branches/SAMBA_3_0/source/passdb/pdb_ldap.c =================================================================== --- branches/SAMBA_3_0/source/passdb/pdb_ldap.c 2004-10-04 14:40:53 UTC (rev 2818) +++ branches/SAMBA_3_0/source/passdb/pdb_ldap.c 2004-10-04 15:53:33 UTC (rev 2819) @@ -727,6 +727,9 @@ uint8 *pwhist = NULL; int i; + /* We can only store (sizeof(pstring)-1)/64 password history entries. */ + pwHistLen = MIN(pwHistLen, ((sizeof(temp)-1)/64)); + if ((pwhist = malloc(pwHistLen * PW_HISTORY_ENTRY_LEN)) == NULL){ DEBUG(0, ("init_sam_from_ldap: malloc failed!\n")); return False; Modified: trunk/source/passdb/pdb_ldap.c =================================================================== --- trunk/source/passdb/pdb_ldap.c 2004-10-04 14:40:53 UTC (rev 2818) +++ trunk/source/passdb/pdb_ldap.c 2004-10-04 15:53:33 UTC (rev 2819) @@ -756,6 +756,9 @@ uint8 *pwhist = NULL; int i; + /* We can only store (sizeof(pstring)-1)/64 password history entries. */ + pwHistLen = MIN(pwHistLen, ((sizeof(temp)-1)/64)); + if ((pwhist = malloc(pwHistLen * PW_HISTORY_ENTRY_LEN)) == NULL){ DEBUG(0, ("init_sam_from_ldap: malloc failed!\n")); return False;