diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-02-09 01:49:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:55 -0500 |
commit | 728ff99fe3b06794937f5398bb2512f0b03e7186 (patch) | |
tree | 87caacf7f24d81f9d61bd6170a41b615d467e415 /source4/libnet | |
parent | 9ca02af51059244a9b30cda8575b0e535e86f4b9 (diff) | |
download | samba-728ff99fe3b06794937f5398bb2512f0b03e7186.tar.gz samba-728ff99fe3b06794937f5398bb2512f0b03e7186.tar.bz2 samba-728ff99fe3b06794937f5398bb2512f0b03e7186.zip |
r21255: Add a debugging option to avoid rid decryption in the samsync output.
Andrew Bartlett
(This used to be commit 9e15a51579157405b2013b9b948d279fefd0eda6)
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_vampire.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index bda80db90f..32879e7610 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -50,14 +50,16 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx, const char *username = user->account_name.string; NTSTATUS nt_status; - if (user->lm_password_present) { - sam_rid_crypt(rid, user->lmpassword.hash, lm_hash.hash, 0); - user->lmpassword = lm_hash; - } - - if (user->nt_password_present) { - sam_rid_crypt(rid, user->ntpassword.hash, nt_hash.hash, 0); - user->ntpassword = nt_hash; + if (lp_parm_bool(-1, "vampire", "rid_decrypt", True)) { + if (user->lm_password_present) { + sam_rid_crypt(rid, user->lmpassword.hash, lm_hash.hash, 0); + user->lmpassword = lm_hash; + } + + if (user->nt_password_present) { + sam_rid_crypt(rid, user->ntpassword.hash, nt_hash.hash, 0); + user->ntpassword = nt_hash; + } } if (user->user_private_info.SensitiveData) { @@ -72,13 +74,21 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx, nt_status = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS); if (NT_STATUS_IS_OK(nt_status)) { if (keys.keys.keys2.lmpassword.length == 16) { - sam_rid_crypt(rid, keys.keys.keys2.lmpassword.pwd.hash, lm_hash.hash, 0); - user->lmpassword = lm_hash; + if (lp_parm_bool(-1, "vampire", "rid decrypt", True)) { + sam_rid_crypt(rid, keys.keys.keys2.lmpassword.pwd.hash, lm_hash.hash, 0); + user->lmpassword = lm_hash; + } else { + user->lmpassword = keys.keys.keys2.lmpassword.pwd; + } user->lm_password_present = True; } if (keys.keys.keys2.ntpassword.length == 16) { - sam_rid_crypt(rid, keys.keys.keys2.ntpassword.pwd.hash, nt_hash.hash, 0); - user->ntpassword = nt_hash; + if (lp_parm_bool(-1, "vampire", "rid decrypt", True)) { + sam_rid_crypt(rid, keys.keys.keys2.ntpassword.pwd.hash, nt_hash.hash, 0); + user->ntpassword = nt_hash; + } else { + user->ntpassword = keys.keys.keys2.ntpassword.pwd; + } user->nt_password_present = True; } } else { |