[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-981-ge6b6027

Günther Deschner gd at samba.org
Wed May 13 20:24:17 GMT 2009


The branch, v3-4-test has been updated
       via  e6b6027218b96bf3357837d051ca5d2df0d88561 (commit)
       via  e88de848c0228cd515b4e356aafe5d7207e49d75 (commit)
       via  198fd3f89c2ce60523c755c1917b7bca25436bf1 (commit)
       via  7c44471f567dc1775f5b4ebf216475b1f348c42a (commit)
       via  737ac891e0be2fafbbc1e2c60f081268b7c0c3a1 (commit)
      from  0c54e8b3e4f9d7efe1974fa39a039997196b6309 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test


- Log -----------------------------------------------------------------
commit e6b6027218b96bf3357837d051ca5d2df0d88561
Author: Günther Deschner <gd at samba.org>
Date:   Tue May 12 14:15:01 2009 +0200

    s3-printing: no need to define struct table_node 4 times.
    
    Guenther
    (cherry picked from commit 652251701df7dec1401eab9b1dbc7e3ac5c7e7ad)

commit e88de848c0228cd515b4e356aafe5d7207e49d75
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 13 15:17:46 2009 +0200

    s3-net: Fix bug 6340: don't segfault when cleartext trustdom pwd could not be retrieved.
    
    Guenther

commit 198fd3f89c2ce60523c755c1917b7bca25436bf1
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 13 15:15:30 2009 +0200

    s4-selftest: match new name of RPC-SAMR-ACCESSMASK.
    
    Guenther
    (cherry picked from commit c3e61b54606175858d2221e5f4a75f2fcf149631)

commit 7c44471f567dc1775f5b4ebf216475b1f348c42a
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 13 15:14:20 2009 +0200

    s4-smbtorture: split RPC-SAMR-ACCESSMASK into several tests.
    
    Guenther
    (cherry picked from commit 675e52cde78906a63fe96e6d34aab92eb710c6b2)

commit 737ac891e0be2fafbbc1e2c60f081268b7c0c3a1
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 13 03:18:07 2009 +0200

    s4-smbtorture: cosmetic cleanup for RPC-SAMR-ACCESSMASK.
    
    Guenther
    (cherry picked from commit 2abdfab613b9487138612bf4ad0422ce4771d7cc)

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

Summary of changes:
 source3/include/nt_printing.h         |    6 ++
 source3/printing/nt_printing.c        |    8 +--
 source3/rpc_server/srv_spoolss_nt.c   |    8 +--
 source3/rpcclient/cmd_spoolss.c       |    8 +--
 source3/utils/net_rpc.c               |    2 +-
 source3/utils/net_rpc_printer.c       |    9 +--
 source4/selftest/knownfail            |    1 +
 source4/selftest/skip                 |    3 +-
 source4/torture/rpc/samr_accessmask.c |  152 +++++++++++++++-----------------
 9 files changed, 84 insertions(+), 113 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 7dc60a8..8fea8fb 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -475,4 +475,10 @@ typedef struct _Printer{
 #define DRIVER_ANY_VERSION		0xffffffff
 #define DRIVER_MAX_VERSION		4
 
+struct print_architecture_table_node {
+	const char 	*long_archi;
+	const char 	*short_archi;
+	int	version;
+};
+
 #endif /* NT_PRINTING_H_ */
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index ad842e4..afb3406 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -204,13 +204,7 @@ static const nt_forms_struct default_forms[] = {
 	{"PRC Envelope #10 Rotated",0x1,0x6fd10,0x4f1a0,0x0,0x0,0x6fd10,0x4f1a0}
 };
 
-struct table_node {
-	const char 	*long_archi;
-	const char 	*short_archi;
-	int	version;
-};
-
-static const struct table_node archi_table[]= {
+static const struct print_architecture_table_node archi_table[]= {
 
 	{"Windows 4.0",          SPL_ARCH_WIN40,	0 },
 	{"Windows NT x86",       SPL_ARCH_W32X86,	2 },
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 50011d1..5c56acf 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -53,12 +53,6 @@ extern userdom_struct current_user_info;
 #define MAGIC_DISPLAY_FREQUENCY 0xfade2bad
 #define PHANTOM_DEVMODE_KEY "_p_f_a_n_t_0_m_"
 
-struct table_node {
-	const char    *long_archi;
-	const char    *short_archi;
-	int     version;
-};
-
 static Printer_entry *printers_list;
 
 typedef struct _counter_printer_0 {
@@ -2078,7 +2072,7 @@ WERROR _spoolss_DeletePrinter(pipes_struct *p,
 static int get_version_id(const char *arch)
 {
 	int i;
-	struct table_node archi_table[]= {
+	struct print_architecture_table_node archi_table[]= {
 
 	        {"Windows 4.0",          "WIN40",       0 },
 	        {"Windows NT x86",       "W32X86",      2 },
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index f3fbabf..99bc129 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -32,12 +32,6 @@
 	W_ERROR_HAVE_NO_MEMORY(_printername); \
 }
 
-struct table_node {
-	const char 	*long_archi;
-	const char 	*short_archi;
-	int	version;
-};
-
 /* The version int is used by getdrivers.  Note that
    all architecture strings that support mutliple
    versions must be grouped together since enumdrivers
@@ -45,7 +39,7 @@ struct table_node {
    enumdriver calls for the same arch */
 
 
-static const struct table_node archi_table[]= {
+static const struct print_architecture_table_node archi_table[]= {
 
 	{"Windows 4.0",          "WIN40",	0 },
 	{"Windows NT x86",       "W32X86",	2 },
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 50ab623..3a1aeb0 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -5738,7 +5738,7 @@ static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd,
 	union lsa_TrustedDomainInfo *info = NULL;
 	char *cleartextpwd = NULL;
 	uint8_t nt_hash[16];
-	DATA_BLOB data;
+	DATA_BLOB data = data_blob_null;
 
 	nt_status = rpccli_lsa_QueryTrustedDomainInfoBySid(pipe_hnd, mem_ctx,
 							   pol,
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 9721628..21be2f4 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -19,15 +19,8 @@
 #include "includes.h"
 #include "utils/net.h"
 
-struct table_node {
-	const char *long_archi;
-	const char *short_archi;
-	int version;
-};
-
-
 /* support itanium as well */
-static const struct table_node archi_table[]= {
+static const struct print_architecture_table_node archi_table[]= {
 
 	{"Windows 4.0",          "WIN40",	0 },
 	{"Windows NT x86",       "W32X86",	2 },
diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
index f5aaaa0..89fccdf 100644
--- a/source4/selftest/knownfail
+++ b/source4/selftest/knownfail
@@ -36,6 +36,7 @@ rpc.netlogon.*.GetPassword
 rpc.netlogon.*.GetTrustPasswords
 rpc.netlogon.*.DatabaseRedo
 rpc.netlogon.*.ServerGetTrustInfo
+samba4.rpc.samr.passwords.pwdlastset # Not provided by Samba 4 yet
 base.charset.*.Testing partial surrogate
 .*net.api.delshare.*				# DelShare isn't implemented yet
 rap.*netservergetinfo
diff --git a/source4/selftest/skip b/source4/selftest/skip
index 291ad84..3c36090 100644
--- a/source4/selftest/skip
+++ b/source4/selftest/skip
@@ -22,8 +22,7 @@ base.nttrans
 base.scan.maxfid
 raw.hold.oplock		# Not a test, but a way to block other clients for a test
 raw.ping.pong		# Needs second server to test
-rpc.samr_accessmask
-samba4.rpc.samr.passwords.pwdlastset # Not provided by Samba 4 yet
+rpc.samr.accessmask
 raw.scan.eamax
 samba4.ntvfs.cifs.raw.qfileinfo.ipc
 smb2.notify
diff --git a/source4/torture/rpc/samr_accessmask.c b/source4/torture/rpc/samr_accessmask.c
index fb560be..1e74455 100644
--- a/source4/torture/rpc/samr_accessmask.c
+++ b/source4/torture/rpc/samr_accessmask.c
@@ -1,19 +1,19 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    test suite for accessmasks on the SAMR pipe
 
    Copyright (C) Ronnie Sahlberg 2007
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -32,8 +32,8 @@
 
 
 static NTSTATUS torture_samr_Close(struct torture_context *tctx,
-		struct dcerpc_pipe *p, 
-		struct policy_handle *h)
+				   struct dcerpc_pipe *p,
+				   struct policy_handle *h)
 {
 	NTSTATUS status;
 	struct samr_Close cl;
@@ -46,8 +46,8 @@ static NTSTATUS torture_samr_Close(struct torture_context *tctx,
 }
 
 static NTSTATUS torture_samr_Connect5(struct torture_context *tctx,
-		struct dcerpc_pipe *p, 
-		uint32_t mask, struct policy_handle *h)
+				      struct dcerpc_pipe *p,
+				      uint32_t mask, struct policy_handle *h)
 {
 	NTSTATUS status;
 	struct samr_Connect5 r5;
@@ -70,8 +70,8 @@ static NTSTATUS torture_samr_Connect5(struct torture_context *tctx,
 }
 
 /* check which bits in accessmask allows us to connect to the server */
-static bool test_samr_accessmask_Connect5(struct torture_context *tctx, 
-						   struct dcerpc_pipe *p)
+static bool test_samr_accessmask_Connect5(struct torture_context *tctx,
+					  struct dcerpc_pipe *p)
 {
 	NTSTATUS status;
 	struct policy_handle h;
@@ -80,7 +80,7 @@ static bool test_samr_accessmask_Connect5(struct torture_context *tctx,
 
 	printf("testing which bits in accessmask allows us to connect\n");
 	mask = 1;
-	for (i=0;i<33;i++) {	
+	for (i=0;i<33;i++) {
 		printf("testing Connect5 with access mask 0x%08x", mask);
 		status = torture_samr_Connect5(tctx, p, mask, &h);
 		mask <<= 1;
@@ -140,8 +140,8 @@ static bool test_samr_accessmask_Connect5(struct torture_context *tctx,
    in the access mask to Connect5() in order to be allowed to perform
    EnumDomains() on the policy handle returned from Connect5()
 */
-static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx, 
-						   struct dcerpc_pipe *p)
+static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
+					     struct dcerpc_pipe *p)
 {
 	NTSTATUS status;
 	struct samr_EnumDomains ed;
@@ -154,7 +154,7 @@ static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
 
 	printf("testing which bits in Connect5 accessmask allows us to EnumDomains\n");
 	mask = 1;
-	for (i=0;i<33;i++) {	
+	for (i=0;i<33;i++) {
 		printf("testing Connect5/EnumDomains with access mask 0x%08x", mask);
 		status = torture_samr_Connect5(tctx, p, mask, &ch);
 		mask <<= 1;
@@ -225,16 +225,16 @@ static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
 
 
 /*
- * test how ACLs affect how/if a user can connect to the SAMR service 
+ * test how ACLs affect how/if a user can connect to the SAMR service
  *
  * samr_SetSecurity() returns SUCCESS when changing the ACL for
  * a policy handle got from Connect5()   but the ACL is not changed on
  * the server
  */
-static bool test_samr_connect_user_acl(struct torture_context *tctx, 
-				   struct dcerpc_pipe *p,
-				   struct cli_credentials *test_credentials,
-				   const struct dom_sid *test_sid)
+static bool test_samr_connect_user_acl(struct torture_context *tctx,
+				       struct dcerpc_pipe *p,
+				       struct cli_credentials *test_credentials,
+				       const struct dom_sid *test_sid)
 
 {
 	NTSTATUS status;
@@ -259,7 +259,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
 		return false;
 	}
 
-	
+
 	/* get the current ACL for the SAMR policy handle */
 	qs.in.handle = &ch;
 	qs.in.sec_info = SECINFO_DACL;
@@ -299,7 +299,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
 
 
 	/* Try to connect as the test user */
-	status = dcerpc_pipe_connect(tctx, 
+	status = dcerpc_pipe_connect(tctx,
 			     &test_p, binding, &ndr_table_samr,
 			     test_credentials, tctx->ev, tctx->lp_ctx);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -317,7 +317,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
 	talloc_free(test_p);
 
 
-	/* read the sequrity descriptor back. it should not have changed 
+	/* read the sequrity descriptor back. it should not have changed
 	 * eventhough samr_SetSecurity returned SUCCESS
 	 */
 	status = dcerpc_samr_QuerySecurity(p, tctx, &qs);
@@ -347,14 +347,14 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
  * test if the ACLs are enforced for users.
  * a normal testuser only gets the rights provided in hte ACL for
  * Everyone   which does not include the SAMR_ACCESS_SHUTDOWN_SERVER
- * right.  If the ACLs are checked when a user connects   
+ * right.  If the ACLs are checked when a user connects
  * a testuser that requests the accessmask with only this bit set
  * the connect should fail.
  */
-static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx, 
-				   struct dcerpc_pipe *p,
-				   struct cli_credentials *test_credentials,
-				   const struct dom_sid *test_sid)
+static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
+						struct dcerpc_pipe *p,
+						struct cli_credentials *test_credentials,
+						const struct dom_sid *test_sid)
 
 {
 	NTSTATUS status;
@@ -366,7 +366,7 @@ static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
 	printf("testing if ACLs are enforced for non domain admin users when connecting to SAMR");
 
 
-	status = dcerpc_pipe_connect(tctx, 
+	status = dcerpc_pipe_connect(tctx,
 			     &test_p, binding, &ndr_table_samr,
 			     test_credentials, tctx->ev, tctx->lp_ctx);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -392,13 +392,13 @@ static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
    by default we must specify at least one of :
    in the access mask to Connect5() in order to be allowed to perform
 		case 5:  samr/opendomain
-		case 25: Maximum 
+		case 25: Maximum
 		case 28: GenericAll
 		case 29: GenericExecute
    LookupDomain() on the policy handle returned from Connect5()
 */
-static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx, 
-						   struct dcerpc_pipe *p)
+static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
+					      struct dcerpc_pipe *p)
 {
 	NTSTATUS status;
 	struct samr_LookupDomain ld;
@@ -410,13 +410,13 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
 
 	printf("testing which bits in Connect5 accessmask allows us to LookupDomain\n");
 	mask = 1;
-	for (i=0;i<33;i++) {	
+	for (i=0;i<33;i++) {
 		printf("testing Connect5/LookupDomain with access mask 0x%08x", mask);
 		status = torture_samr_Connect5(tctx, p, mask, &ch);
 		mask <<= 1;
 
 		switch (i) {
-		case 5:  
+		case 5:
 		case 25: /* Maximum */
 		case 28: /* GenericAll */
 		case 29: /* GenericExecute */
@@ -478,14 +478,14 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
 /* check which bits in accessmask allows us to OpenDomain()
    by default we must specify at least one of :
 	samr/opendomain
-	Maximum 
+	Maximum
 	GenericAll
 	GenericExecute
    in the access mask to Connect5() in order to be allowed to perform
    OpenDomain() on the policy handle returned from Connect5()
 */
-static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx, 
-						   struct dcerpc_pipe *p)
+static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
+					    struct dcerpc_pipe *p)
 {
 	NTSTATUS status;
 	struct samr_LookupDomain ld;
@@ -519,13 +519,13 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
 
 	printf("testing which bits in Connect5 accessmask allows us to OpenDomain\n");
 	mask = 1;
-	for (i=0;i<33;i++) {	
+	for (i=0;i<33;i++) {
 		printf("testing Connect5/OpenDomain with access mask 0x%08x", mask);
 		status = torture_samr_Connect5(tctx, p, mask, &ch);
 		mask <<= 1;
 
 		switch (i) {
-		case 5:  
+		case 5:
 		case 25: /* Maximum */
 		case 28: /* GenericAll */
 		case 29: /* GenericExecute */
@@ -579,8 +579,8 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
 	return true;
 }
 
-static bool test_samr_connect(struct torture_context *tctx, 
-						   struct dcerpc_pipe *p)
+static bool test_samr_connect(struct torture_context *tctx,
+			      struct dcerpc_pipe *p)
 {
 	void *testuser;
 	const char *testuser_passwd;
@@ -588,8 +588,12 @@ static bool test_samr_connect(struct torture_context *tctx,
 	bool ret = true;
 	const struct dom_sid *test_sid;
 
+	if (torture_setting_bool(tctx, "samba3", false)) {
+		torture_skip(tctx, "Skipping test against Samba 3");
+	}
+
 	/* create a test user */
-	testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(tctx->lp_ctx), 
+	testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(tctx->lp_ctx),
 					   ACB_NORMAL, &testuser_passwd);
 	if (!testuser) {
 		printf("Failed to create test user\n");
@@ -597,45 +601,13 @@ static bool test_samr_connect(struct torture_context *tctx,
 	}
 	test_credentials = cli_credentials_init(tctx);
 	cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED);
-	cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx), 
+	cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx),
 				   CRED_SPECIFIED);
 	cli_credentials_set_username(test_credentials, TEST_USER_NAME, CRED_SPECIFIED);
 	cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED);
 	test_sid = torture_join_user_sid(testuser);
 
 
-	/* test which bits in the accessmask to Connect5 
-	   will allow us to connect to the server 
-	*/
-	if (!test_samr_accessmask_Connect5(tctx, p)) {
-		ret = false;
-	}
-
-
-	/* test which bits in the accessmask to Connect5 will allow
-	 * us to call EnumDomains() 
-	 */
-	if (!test_samr_accessmask_EnumDomains(tctx, p)) {
-		ret = false;
-	}
-
-	/* test which bits in the accessmask to Connect5 will allow
-	 * us to call LookupDomain()
-	 */
-	if (!test_samr_accessmask_LookupDomain(tctx, p)) {
-		ret = false;
-	}
-
-
-	/* test which bits in the accessmask to Connect5 will allow
-	 * us to call OpenDomain()
-	 */
-	if (!test_samr_accessmask_OpenDomain(tctx, p)) {
-		ret = false;
-	}
-
-	if (!torture_setting_bool(tctx, "samba3", false)) {
-
 	/* test if ACLs can be changed for the policy handle
 	 * returned by Connect5
 	 */
@@ -643,7 +615,7 @@ static bool test_samr_connect(struct torture_context *tctx,
 		ret = false;
 	}
 
-	/* test if the ACLs that are reported from the Connect5 
+	/* test if the ACLs that are reported from the Connect5
 	 * policy handle is enforced.
 	 * i.e. an ordinary user only has the same rights as Everybody
 	 *   ReadControl
@@ -657,8 +629,6 @@ static bool test_samr_connect(struct torture_context *tctx,
 		ret = false;
 	}
 
-	}
-
 	/* remove the test user */
 	torture_leave_domain(tctx, testuser);
 
@@ -667,13 +637,33 @@ static bool test_samr_connect(struct torture_context *tctx,
 
 struct torture_suite *torture_rpc_samr_accessmask(TALLOC_CTX *mem_ctx)
 {
-	struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR_ACCESSMASK");
+	struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-ACCESSMASK");
 	struct torture_rpc_tcase *tcase;
 
-	tcase = torture_suite_add_rpc_iface_tcase(suite, "samr", 
-											  &ndr_table_samr);
-	
+	tcase = torture_suite_add_rpc_iface_tcase(suite, "samr",
+						  &ndr_table_samr);
+
 	torture_rpc_tcase_add_test(tcase, "CONNECT", test_samr_connect);
 
+	/* test which bits in the accessmask to Connect5 will allow
+	 * us to call OpenDomain() */
+	torture_rpc_tcase_add_test(tcase, "OpenDomain",
+				   test_samr_accessmask_OpenDomain);
+
+	/* test which bits in the accessmask to Connect5 will allow
+	 * us to call LookupDomain() */
+	torture_rpc_tcase_add_test(tcase, "LookupDomain",
+				   test_samr_accessmask_LookupDomain);
+
+	/* test which bits in the accessmask to Connect5 will allow
+	 * us to call EnumDomains() */
+	torture_rpc_tcase_add_test(tcase, "EnumDomains",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list