summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_get_set.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-12-14 19:16:58 +0100
committerMichael Adam <obnox@samba.org>2010-01-07 11:07:54 +0100
commit2a11f3b3d7b4a009ddfa70511ad2ce3b84aa0539 (patch)
tree7e4cc0e89276f2fbcfea5698307839c59f4d667f /source3/passdb/pdb_get_set.c
parentec0998ada5eebf5cae63719ef14097639ffef258 (diff)
downloadsamba-2a11f3b3d7b4a009ddfa70511ad2ce3b84aa0539.tar.gz
samba-2a11f3b3d7b4a009ddfa70511ad2ce3b84aa0539.tar.bz2
samba-2a11f3b3d7b4a009ddfa70511ad2ce3b84aa0539.zip
s3: Simplify pdb_set_plaintext_passwd: pwHistLen==0 was checked above
Diffstat (limited to 'source3/passdb/pdb_get_set.c')
-rw-r--r--source3/passdb/pdb_get_set.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index ba19b6bd43..eed3591fd6 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -1043,7 +1043,9 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext)
if (current_history_len < pwHistLen) {
/*
- * Ensure we have space for the needed history.
+ * Ensure we have space for the needed history. This
+ * also takes care of an account which did not have
+ * any history at all so far, i.e. pwhistory==NULL
*/
uchar *new_history = talloc_zero_array(
sampass, uchar,
@@ -1059,7 +1061,7 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext)
pwhistory = new_history;
}
- if (pwhistory && pwHistLen) {
+ if (pwhistory != NULL) {
/*
* Make room for the new password in the history list.
*/