[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Wed Feb 17 17:49:35 MST 2010


The branch, master has been updated
       via  998a7b4... s4-smbtorture: skip printer info cross tests against samba 3 for now.
       via  97d3637... s4-smbtorture: try more combinations to find printers in test_EnumPrinters_findname().
       via  a1ba72f... s4-smbtorture: simplify test_PrinterInfo_DevMode a bit.
       via  57847c2... s4-smbtorture: avoid potential loop while adding a new printer in RPC-SPOOLSS-PRINTER.
      from  d5e30de... s3-rpcclient: fix uninitialized variable in wkssvc_enumerateusers.

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


- Log -----------------------------------------------------------------
commit 998a7b4e3f50c49df3ad391a21c14e3df5e377eb
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 18 01:45:06 2010 +0100

    s4-smbtorture: skip printer info cross tests against samba 3 for now.
    
    Not even w2k8r2 passes them atm.
    
    Guenther

commit 97d36377d3521c762c20c9a81482741d0f325964
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 18 01:43:08 2010 +0100

    s4-smbtorture: try more combinations to find printers in test_EnumPrinters_findname().
    
    Also take a note of servers returning full UNC printer paths although we did not
    set the servername.
    
    Guenther

commit a1ba72f84c6256e2b6cacfe4d6016ba2c1b832d1
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 18 01:41:46 2010 +0100

    s4-smbtorture: simplify test_PrinterInfo_DevMode a bit.
    
    Guenther

commit 57847c2fee1a19c388ab84f5c629212f70cde62d
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 17 20:45:26 2010 +0100

    s4-smbtorture: avoid potential loop while adding a new printer in RPC-SPOOLSS-PRINTER.
    
    Guenther

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

Summary of changes:
 source4/torture/rpc/spoolss.c |   46 +++++++++++++++++++++++++---------------
 1 files changed, 29 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 0c9c076..08cb4f2 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -2007,16 +2007,13 @@ static bool test_PrinterInfo_DevMode(struct torture_context *tctx,
 				     const char *name)
 {
 	union spoolss_PrinterInfo info;
-	struct spoolss_SetPrinterInfo8 info8;
-	struct spoolss_SetPrinterInfoCtr info_ctr;
-	struct spoolss_DevmodeContainer devmode_ctr;
-	struct sec_desc_buf secdesc_ctr;
 	struct spoolss_DeviceMode *devmode;
 	bool ret = true;
 
 	/* save original devmode */
 
-	torture_assert(tctx, test_GetPrinter_level(tctx, p, handle, 8, &info), "");
+	torture_assert(tctx, test_GetPrinter_level(tctx, p, handle, 8, &info),
+		"failed to get initial global devicemode");
 
 	devmode = info.info8.devmode;
 
@@ -2026,18 +2023,8 @@ static bool test_PrinterInfo_DevMode(struct torture_context *tctx,
 
 	/* restore original devmode */
 
-	ZERO_STRUCT(devmode_ctr);
-	ZERO_STRUCT(secdesc_ctr);
-
-	info8.devmode_ptr = 0;
-
-	info_ctr.level = 8;
-	info_ctr.info.info8 = &info8;
-
-	devmode_ctr.devmode = devmode;
-
-	torture_assert(tctx,
-		test_SetPrinter(tctx, p, handle, &info_ctr, &devmode_ctr, &secdesc_ctr, 0), "");
+	torture_assert(tctx, test_devmode_set_level(tctx, p, handle, 8, devmode),
+		"failed to restore initial global device mode");
 
 	return ret;
 }
@@ -3899,6 +3886,7 @@ static bool test_EnumPrinters_findname(struct torture_context *tctx,
 	for (i=0; i < count; i++) {
 
 		const char *current = NULL;
+		const char *p;
 
 		switch (level) {
 		case 1:
@@ -3910,6 +3898,19 @@ static bool test_EnumPrinters_findname(struct torture_context *tctx,
 			*found = true;
 			break;
 		}
+
+		p = strrchr(current, '\\');
+		if (p) {
+			if (!e.in.server) {
+				torture_warning(tctx,
+					"server returns printername %s incl. servername although we did not set servername", current);
+			}
+			p++;
+			if (strequal(p, name)) {
+				*found = true;
+				break;
+			}
+		}
 	}
 
 	return true;
@@ -4030,6 +4031,7 @@ static bool test_AddPrinter_normal(struct torture_context *tctx,
 	struct spoolss_UserLevelCtr userlevel_ctr;
 	struct policy_handle handle;
 	bool found = false;
+	bool existing_printer_deleted = false;
 
 	ZERO_STRUCT(devmode_ctr);
 	ZERO_STRUCT(secdesc_ctr);
@@ -4078,6 +4080,10 @@ static bool test_AddPrinter_normal(struct torture_context *tctx,
 	if (W_ERROR_EQUAL(result, WERR_PRINTER_ALREADY_EXISTS)) {
 		struct policy_handle printer_handle;
 
+		if (existing_printer_deleted) {
+			torture_fail(tctx, "already deleted printer still existing?");
+		}
+
 		torture_assert(tctx, call_OpenPrinterEx(tctx, p, printername, NULL, &printer_handle),
 			"failed to open printer handle");
 
@@ -4087,6 +4093,8 @@ static bool test_AddPrinter_normal(struct torture_context *tctx,
 		torture_assert(tctx, test_ClosePrinter(tctx, p, &printer_handle),
 			"failed to close server handle");
 
+		existing_printer_deleted = true;
+
 		goto again;
 	}
 
@@ -4204,6 +4212,10 @@ static bool test_printer_info(struct torture_context *tctx,
 {
 	bool ret = true;
 
+	if (torture_setting_bool(tctx, "samba3", false)) {
+		torture_skip(tctx, "skipping printer info cross tests against samba 3");
+	}
+
 	if (!test_PrinterInfo(tctx, p, handle)) {
 		ret = false;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list