[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Thu Dec 17 07:41:07 MST 2009


The branch, master has been updated
       via  619ad0c... s4-smbtorture: add a samr_GetAliasMembership test to RPC-SAMR.
       via  a23084e... tdbtool: avoid using c++ reserved words.
      from  eb7ff92... s3: Run RPC-SAMBA3-GETALIASMEMBERSHIP-0 in make test

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


- Log -----------------------------------------------------------------
commit 619ad0c6ecf88a861ad1a1e1d5564bd1f91855cc
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 17 15:34:22 2009 +0100

    s4-smbtorture: add a samr_GetAliasMembership test to RPC-SAMR.
    
    Guenther

commit a23084e1e89a44cf692f6e205263ee53371b80c9
Author: Günther Deschner <gd at samba.org>
Date:   Thu Dec 17 00:13:23 2009 +0100

    tdbtool: avoid using c++ reserved words.
    
    Guenther

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

Summary of changes:
 lib/tdb/tools/tdbtool.c    |    4 +-
 source4/torture/rpc/samr.c |   47 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tdb/tools/tdbtool.c b/lib/tdb/tools/tdbtool.c
index b380883..2ba7efc 100644
--- a/lib/tdb/tools/tdbtool.c
+++ b/lib/tdb/tools/tdbtool.c
@@ -538,9 +538,9 @@ static void next_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey)
 		print_rec(the_tdb, *pkey, dbuf, NULL);
 }
 
-static int count(TDB_DATA key, TDB_DATA data, void *private)
+static int count(TDB_DATA key, TDB_DATA data, void *private_data)
 {
-	(*(unsigned int *)private)++;
+	(*(unsigned int *)private_data)++;
 	return 0;
 }
 
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 986f293..03425ea 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -2593,6 +2593,52 @@ static bool test_AddMultipleMembersToAlias(struct dcerpc_pipe *p, struct torture
 	return true;
 }
 
+static bool test_GetAliasMembership(struct dcerpc_pipe *p,
+				    struct torture_context *tctx,
+				    struct policy_handle *domain_handle)
+{
+	struct samr_GetAliasMembership r;
+	struct lsa_SidArray sids;
+	struct samr_Ids rids;
+	NTSTATUS status;
+
+	torture_comment(tctx, "Testing GetAliasMembership\n");
+
+	r.in.domain_handle	= domain_handle;
+	r.in.sids		= &sids;
+	r.out.rids		= &rids;
+
+	sids.num_sids = 0;
+	sids.sids = talloc_zero_array(tctx, struct lsa_SidPtr, sids.num_sids);
+
+	status = dcerpc_samr_GetAliasMembership(p, tctx, &r);
+	torture_assert_ntstatus_ok(tctx, status,
+		"samr_GetAliasMembership failed");
+
+	torture_assert_int_equal(tctx, sids.num_sids, rids.count,
+		"protocol misbehaviour");
+
+	sids.num_sids = 1;
+	sids.sids = talloc_zero_array(tctx, struct lsa_SidPtr, sids.num_sids);
+	sids.sids[0].sid = dom_sid_parse_talloc(tctx, "S-1-5-32-1-2-3-1");
+
+	status = dcerpc_samr_GetAliasMembership(p, tctx, &r);
+	torture_assert_ntstatus_ok(tctx, status,
+		"samr_GetAliasMembership failed");
+
+#if 0
+	/* only true for w2k8 it seems
+	 * win7, xp, w2k3 will return a 0 length array pointer */
+
+	torture_assert(tctx, (rids.ids && !rids.count),
+		"samr_GetAliasMembership protocol misbehaviour");
+#endif
+	torture_assert(tctx, (!rids.ids && rids.count),
+		"samr_GetAliasMembership protocol misbehaviour");
+
+	return true;
+}
+
 static bool test_TestPrivateFunctionsUser(struct dcerpc_pipe *p, struct torture_context *tctx,
 					    struct policy_handle *user_handle)
 {
@@ -6504,6 +6550,7 @@ static bool test_OpenDomain(struct dcerpc_pipe *p, struct torture_context *tctx,
 		ret &= test_RemoveMemberFromForeignDomain(p, tctx, &domain_handle);
 		ret &= test_CreateAlias(p, tctx, &domain_handle, TEST_ALIASNAME, &alias_handle, sid, true);
 		ret &= test_CreateDomainGroup(p, tctx, &domain_handle, TEST_GROUPNAME, &group_handle, sid, true);
+		ret &= test_GetAliasMembership(p, tctx, &domain_handle);
 		ret &= test_QueryDomainInfo(p, tctx, &domain_handle);
 		ret &= test_QueryDomainInfo2(p, tctx, &domain_handle);
 		ret &= test_EnumDomainUsers_all(p, tctx, &domain_handle);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list