[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1260-gbfa753f

Andrew Bartlett abartlet at samba.org
Fri Apr 24 07:19:17 GMT 2009


The branch, master has been updated
       via  bfa753f1c0b8687f33fc9f2e90011e8f1786d1ae (commit)
       via  2ee9ee2c17ce435ce45a773f19302a7b474554c2 (commit)
       via  b82a204b9b2c28707ab7866a511ea4f5912826ac (commit)
       via  f579a2c666cd1ccabfa9452a69c871771941f858 (commit)
      from  af6316d1500cfcedd5fd59ed0ddbba9aec9c3756 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bfa753f1c0b8687f33fc9f2e90011e8f1786d1ae
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 24 09:17:29 2009 +0200

    s4:torture Add tests for prefixMap custom attribute handler

commit 2ee9ee2c17ce435ce45a773f19302a7b474554c2
Merge: b82a204b9b2c28707ab7866a511ea4f5912826ac af6316d1500cfcedd5fd59ed0ddbba9aec9c3756
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 24 09:17:08 2009 +0200

    Merge branch 'master' of ssh://git.samba.org/data/git/samba into abartlet-devel

commit b82a204b9b2c28707ab7866a511ea4f5912826ac
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Apr 23 18:46:24 2009 +0200

    More lcov code coverage generation work

commit f579a2c666cd1ccabfa9452a69c871771941f858
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Apr 23 17:53:25 2009 +0200

    s4:torture use common libcli/auth crypto code

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/config.mk     |    6 +++---
 source4/torture/ldb/ldb.c     |   34 ++++++++++++++++++++++++++++++++++
 source4/torture/rpc/samsync.c |   20 +++++++++-----------
 3 files changed, 46 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 49830d2..3016478 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -351,11 +351,11 @@ gcov: test
 		do $(GCOV) -p -o $$I $$I/*.c; \
 	done
 
-samba.info: test
+samba4.info: test
 	-rm heimdal/lib/*/{lex,parse,sel-lex}.{gcda,gcno}
-	lcov --base-directory `pwd` --directory . --directory ../nsswitch --directory ../libcli --directory ../librpc --directory ../lib --capture --output-file samba.info
+	cd .. && lcov --base-directory `pwd`/source4 --directory source4 --directory nsswitch --directory libcli --directory librpc --directory lib --capture --output-file source4/samba4.info
 
-lcov: samba.info
+lcov: samba4.info
 	genhtml -o coverage $<
 
 testcov-html:: lcov
diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c
index c2977bc..193ccc1 100644
--- a/source4/torture/ldb/ldb.c
+++ b/source4/torture/ldb/ldb.c
@@ -36,6 +36,9 @@ static const char *guid = "975ac5fa-35d9-431d-b86a-845bcd34fff9";
 static const char *guid2 = "{975ac5fa-35d9-431d-b86a-845bcd34fff9}";
 static const char *hex_guid = "FAC55A97D9351D43B86A845BCD34FFF9";
 
+static const char *prefix_map_newline = "2:1.2.840.113556.1.2\n5:2.16.840.1.101.2.2.3";
+static const char *prefix_map_semi = "2:1.2.840.113556.1.2;5:2.16.840.1.101.2.2.3";
+
 static bool torture_ldb_attrs(struct torture_context *torture)
 {
 	TALLOC_CTX *mem_ctx = talloc_new(torture);
@@ -43,6 +46,8 @@ static bool torture_ldb_attrs(struct torture_context *torture)
 	const struct ldb_schema_attribute *attr;
 	struct ldb_val string_sid_blob, binary_sid_blob;
 	struct ldb_val string_guid_blob, string_guid_blob2, binary_guid_blob;
+	struct ldb_val string_prefix_map_newline_blob, string_prefix_map_semi_blob, string_prefix_map_blob;
+	struct ldb_val prefix_map_blob;
 
 	DATA_BLOB sid_blob = strhex_to_data_blob(mem_ctx, hex_sid);
 	DATA_BLOB guid_blob = strhex_to_data_blob(mem_ctx, hex_guid);
@@ -159,8 +164,37 @@ static bool torture_ldb_attrs(struct torture_context *torture)
 				 attr->syntax->comparison_fn(ldb, mem_ctx, &binary_guid_blob, &binary_guid_blob), 0,
 				 "Failed to compare binary and binary GUID");
 	
+	string_prefix_map_newline_blob = data_blob_string_const(prefix_map_newline);
+	
+	string_prefix_map_semi_blob = data_blob_string_const(prefix_map_semi);
 	
+	/* Test prefixMap behaviour */
+	torture_assert(torture, attr = ldb_schema_attribute_by_name(ldb, "prefixMap"), 
+		       "Failed to get prefixMap schema attribute");
+	
+	torture_assert_int_equal(torture, 
+				 attr->syntax->comparison_fn(ldb, mem_ctx, &string_prefix_map_newline_blob, &string_prefix_map_semi_blob), 0,
+				 "Failed to compare prefixMap with newlines and prefixMap with semicolons");
+	
+	torture_assert_int_equal(torture, 
+				 attr->syntax->ldif_read_fn(ldb, mem_ctx, &string_prefix_map_newline_blob, &prefix_map_blob), 0,
+				 "Failed to read prefixMap with newlines");
+	torture_assert_int_equal(torture, 
+				 attr->syntax->comparison_fn(ldb, mem_ctx, &string_prefix_map_newline_blob, &prefix_map_blob), 0,
+				 "Failed to compare prefixMap with newlines and prefixMap binary");
 	
+	torture_assert_int_equal(torture, 
+				 attr->syntax->ldif_write_fn(ldb, mem_ctx, &prefix_map_blob, &string_prefix_map_blob), 0,
+				 "Failed to write prefixMap");
+	torture_assert_int_equal(torture, 
+				 attr->syntax->comparison_fn(ldb, mem_ctx, &string_prefix_map_blob, &prefix_map_blob), 0,
+				 "Failed to compare prefixMap ldif write and prefixMap binary");
+	
+	torture_assert_data_blob_equal(torture, string_prefix_map_blob, string_prefix_map_semi_blob,
+		"Failed to compare prefixMap ldif write and prefixMap binary");
+	
+
+
 	talloc_free(mem_ctx);
 	return true;
 }
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index ee11ede..a67a06d 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -31,6 +31,7 @@
 #include "auth/gensec/schannel_proto.h"
 #include "auth/gensec/gensec.h"
 #include "libcli/auth/libcli_auth.h"
+#include "libcli/samsync/samsync.h"
 #include "libcli/security/security.h"
 #include "librpc/gen_ndr/ndr_netlogon.h"
 #include "librpc/gen_ndr/ndr_netlogon_c.h"
@@ -564,11 +565,9 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct
 	TEST_STRING_EQUAL(info->info21.profile_path, user->profile_path);
 
 	if (user->lm_password_present) {
-		sam_rid_crypt(rid, user->lmpassword.hash, lm_hash.hash, 0);
 		lm_hash_p = &lm_hash;
 	}
 	if (user->nt_password_present) {
-		sam_rid_crypt(rid, user->ntpassword.hash, nt_hash.hash, 0);
 		nt_hash_p = &nt_hash;
 	}
 
@@ -578,15 +577,12 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct
 		enum ndr_err_code ndr_err;
 		data.data = user->user_private_info.SensitiveData;
 		data.length = user->user_private_info.DataLength;
-		netlogon_creds_arcfour_crypt(samsync_state->creds, data.data, data.length);
 		ndr_err = ndr_pull_struct_blob(&data, mem_ctx, lp_iconv_convenience(tctx->lp_ctx), &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
 		if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 			if (keys.keys.keys2.lmpassword.length == 16) {
-				sam_rid_crypt(rid, keys.keys.keys2.lmpassword.pwd.hash, lm_hash.hash, 0);
 				lm_hash_p = &lm_hash;
 			}
 			if (keys.keys.keys2.ntpassword.length == 16) {
-				sam_rid_crypt(rid, keys.keys.keys2.ntpassword.pwd.hash, nt_hash.hash, 0);
 				nt_hash_p = &nt_hash;
 			}
 		} else {
@@ -843,12 +839,6 @@ static bool samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam
 	DATA_BLOB lsa_blob1, lsa_blob_out, session_key;
 	NTSTATUS status;
 
-	netlogon_creds_arcfour_crypt(samsync_state->creds, secret->current_cipher.cipher_data, 
-			    secret->current_cipher.maxlen); 
-
-	netlogon_creds_arcfour_crypt(samsync_state->creds, secret->old_cipher.cipher_data, 
-			    secret->old_cipher.maxlen); 
-
 	nsec->name = talloc_reference(nsec, name);
 	nsec->secret = data_blob_talloc(nsec, secret->current_cipher.cipher_data, secret->current_cipher.maxlen);
 	nsec->mtime = secret->current_cipher_set_time;
@@ -1202,6 +1192,14 @@ static bool test_DatabaseSync(struct torture_context *tctx,
 
 			for (d=0; d < delta_enum_array->num_deltas; d++) {
 				delta_ctx = talloc_named(loop_ctx, 0, "DatabaseSync delta context");
+
+				if (!NT_STATUS_IS_OK(samsync_fix_delta(delta_ctx, samsync_state->creds, 
+								       r.in.database_id, 
+								       &delta_enum_array->delta_enum[d]))) {
+					printf("Failed to decrypt delta\n");
+					ret = false;
+				}
+
 				switch (delta_enum_array->delta_enum[d].delta_type) {
 				case NETR_DELTA_DOMAIN:
 					if (!samsync_handle_domain(delta_ctx, samsync_state, 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list