[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Thu Apr 8 08:14:13 MDT 2010


The branch, master has been updated
       via  1c4c4dd... s4-smbtorture: protect against full UNC paths in winreg printerinfo test.
      from  ef3490e... s4:registry - "REGF backend" - don't ignore wrong-sized REG_DWORD/REG_DWORD_BIG_ENDIAN values

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


- Log -----------------------------------------------------------------
commit 1c4c4dd7e044f20c3de623b189a5c0d65b0a67b4
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 8 16:09:36 2010 +0200

    s4-smbtorture: protect against full UNC paths in winreg printerinfo test.
    
    Guenther

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

Summary of changes:
 source4/torture/rpc/spoolss.c |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 9a647f7..1f6153c 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -3843,6 +3843,26 @@ static bool test_GetForm_winreg(struct torture_context *tctx,
 	return true;
 }
 
+static const char *strip_unc(const char *unc)
+{
+	char *name;
+
+	if (!unc) {
+		return NULL;
+	}
+
+	if (unc[0] == '\\' && unc[1] == '\\') {
+		unc +=2;
+	}
+
+	name = strchr(unc, '\\');
+	if (name) {
+		return name+1;
+	}
+
+	return unc;
+}
+
 static bool test_GetPrinterInfo_winreg(struct torture_context *tctx,
 				       struct dcerpc_binding_handle *b,
 				       struct policy_handle *handle,
@@ -3856,6 +3876,7 @@ static bool test_GetPrinterInfo_winreg(struct torture_context *tctx,
 		TOP_LEVEL_PRINT_PRINTERS_KEY
 	};
 	int i;
+	const char *printername, *sharename;
 
 	torture_comment(tctx, "Testing Printer Info and winreg consistency\n");
 
@@ -3863,6 +3884,9 @@ static bool test_GetPrinterInfo_winreg(struct torture_context *tctx,
 		test_GetPrinter_level(tctx, b, handle, 2, &info),
 		"failed to get printer info level 2");
 
+	printername = strip_unc(info.info2.printername);
+	sharename = strip_unc(info.info2.sharename);
+
 #define test_sz(key, wname, iname) \
 do {\
 	DATA_BLOB blob;\
@@ -3960,8 +3984,8 @@ do {\
 		torture_assert(tctx,
 			test_winreg_OpenKey(tctx, winreg_handle, hive_handle, printer_key, &key_handle), "");
 
-		test_sz(keys[i], "Name", info.info2.printername);
-		test_sz(keys[i], "Share Name", info.info2.sharename);
+		test_sz(keys[i], "Name", printername);
+		test_sz(keys[i], "Share Name", sharename);
 		test_sz(keys[i], "Port", info.info2.portname);
 		test_sz(keys[i], "Printer Driver", info.info2.drivername);
 		test_sz(keys[i], "Description", info.info2.comment);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list