[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Wed Feb 24 03:43:29 MST 2010
The branch, master has been updated
via 1b78573... s4-smbtorture: verify that the client cpu architecture has no influence on the calculated buffer size in RPC-SPOOLSS.
from ec96ea6... tdb: handle processes dying during transaction commit.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 1b78573c2d70b896e1ed3853f596e34523f6f227
Author: Günther Deschner <gd at samba.org>
Date: Tue Feb 23 13:05:52 2010 +0100
s4-smbtorture: verify that the client cpu architecture has no influence on the
calculated buffer size in RPC-SPOOLSS.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source4/torture/rpc/spoolss.c | 72 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 72 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 0a915a7..772abf4 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -4456,6 +4456,77 @@ static bool test_printer(struct torture_context *tctx,
return ret;
}
+static bool test_architecture_buffer(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ struct spoolss_OpenPrinterEx r;
+ struct spoolss_UserLevel1 u1;
+ struct policy_handle handle;
+ uint32_t architectures[] = {
+ PROCESSOR_ARCHITECTURE_INTEL,
+ PROCESSOR_ARCHITECTURE_IA64,
+ PROCESSOR_ARCHITECTURE_AMD64
+ };
+ uint32_t needed[3];
+ int i;
+
+ for (i=0; i < ARRAY_SIZE(architectures); i++) {
+
+ torture_comment(tctx, "Testing OpenPrinterEx with architecture %d\n", architectures[i]);
+
+ u1.size = 0;
+ u1.client = NULL;
+ u1.user = NULL;
+ u1.build = 0;
+ u1.major = 3;
+ u1.minor = 0;
+ u1.processor = architectures[i];
+
+ r.in.printername = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
+ r.in.datatype = NULL;
+ r.in.devmode_ctr.devmode= NULL;
+ r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+ r.in.level = 1;
+ r.in.userlevel.level1 = &u1;
+ r.out.handle = &handle;
+
+ torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_OpenPrinterEx(p, tctx, &r), "");
+ torture_assert_werr_ok(tctx, r.out.result, "");
+
+ {
+ struct spoolss_EnumPrinters e;
+ uint32_t count;
+ union spoolss_PrinterInfo *info;
+
+ e.in.flags = PRINTER_ENUM_LOCAL;
+ e.in.server = NULL;
+ e.in.level = 2;
+ e.in.buffer = NULL;
+ e.in.offered = 0;
+ e.out.count = &count;
+ e.out.info = &info;
+ e.out.needed = &needed[i];
+
+ torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_EnumPrinters(p, tctx, &e), "");
+#if 0
+ torture_comment(tctx, "needed was %d\n", needed[i]);
+#endif
+ }
+
+ torture_assert(tctx, test_ClosePrinter(tctx, p, &handle), "");
+ }
+
+ for (i=1; i < ARRAY_SIZE(architectures); i++) {
+ if (needed[i-1] != needed[i]) {
+ torture_fail(tctx,
+ talloc_asprintf(tctx, "needed size %d for architecture %d != needed size %d for architecture %d\n",
+ needed[i-1], architectures[i-1], needed[i], architectures[i]));
+ }
+ }
+
+ return true;
+}
+
bool torture_rpc_spoolss(struct torture_context *torture)
{
NTSTATUS status;
@@ -4497,6 +4568,7 @@ bool torture_rpc_spoolss(struct torture_context *torture)
ret &= test_EnumPorts_old(torture, p);
ret &= test_EnumPrinters_old(torture, p);
ret &= test_EnumPrinterDrivers_old(torture, p);
+ ret &= test_architecture_buffer(torture, p);
return ret;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list