summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-24 12:39:21 +0200
committerVolker Lendecke <vl@samba.org>2009-06-24 16:30:55 +0200
commite3fb71dac8856a67cac4514dca017dd4b939c520 (patch)
tree84be00b749b109f323dfe9f388ff4e8928f406bb /source3
parent46167c1d1b2ee4d77338214494decd9326b7ab93 (diff)
downloadsamba-e3fb71dac8856a67cac4514dca017dd4b939c520.tar.gz
samba-e3fb71dac8856a67cac4514dca017dd4b939c520.tar.bz2
samba-e3fb71dac8856a67cac4514dca017dd4b939c520.zip
Only set the password if there is one
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_ads.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index d7a5db6b03..f4ab299844 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -267,12 +267,16 @@ static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
"%s", pdb_get_fullname(sam));
blob = data_blob_const(pdb_get_nt_passwd(sam), NT_HASH_LEN);
- ret &= tldap_add_mod_blobs(mem_ctx, pmods, TLDAP_MOD_REPLACE,
- "unicodePwd", 1, &blob);
+ if (blob.data != NULL) {
+ ret &= tldap_add_mod_blobs(mem_ctx, pmods, TLDAP_MOD_REPLACE,
+ "unicodePwd", 1, &blob);
+ }
blob = data_blob_const(pdb_get_lanman_passwd(sam), NT_HASH_LEN);
- ret &= tldap_add_mod_blobs(mem_ctx, pmods, TLDAP_MOD_REPLACE,
- "dBCSPwd", 1, &blob);
+ if (blob.data != NULL) {
+ ret &= tldap_add_mod_blobs(mem_ctx, pmods, TLDAP_MOD_REPLACE,
+ "dBCSPwd", 1, &blob);
+ }
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "userAccountControl",