svn commit: samba r21255 - in branches/SAMBA_4_0/source/libnet: .

abartlet at samba.org abartlet at samba.org
Fri Feb 9 01:49:27 GMT 2007


Author: abartlet
Date: 2007-02-09 01:49:26 +0000 (Fri, 09 Feb 2007)
New Revision: 21255

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21255

Log:
Add a debugging option to avoid rid decryption in the samsync output.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/libnet/libnet_vampire.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_vampire.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_vampire.c	2007-02-09 00:18:06 UTC (rev 21254)
+++ branches/SAMBA_4_0/source/libnet/libnet_vampire.c	2007-02-09 01:49:26 UTC (rev 21255)
@@ -50,16 +50,18 @@
 	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 (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->nt_password_present) {
-		sam_rid_crypt(rid, user->ntpassword.hash, nt_hash.hash, 0);
-		user->ntpassword = nt_hash;
-	}
-
 	if (user->user_private_info.SensitiveData) {
 		DATA_BLOB data;
 		struct netr_USER_KEYS keys;
@@ -72,13 +74,21 @@
 		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 {



More information about the samba-cvs mailing list