summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-01-14 17:26:31 +0100
committerAndreas Schneider <asn@samba.org>2013-01-16 11:42:13 +0100
commita4dcf7b94d8f2d8180bb5b390f49e89e2c956a88 (patch)
tree28136af45498a9d5f94527baf6fa52854af4770a /source4/torture
parent6bb7bf9ebb0671be19419ba54955dd929494c8e8 (diff)
downloadsamba-a4dcf7b94d8f2d8180bb5b390f49e89e2c956a88.tar.gz
samba-a4dcf7b94d8f2d8180bb5b390f49e89e2c956a88.tar.bz2
samba-a4dcf7b94d8f2d8180bb5b390f49e89e2c956a88.zip
spoolss: Make OpenPrinterEx work with NDR64 by using UserInfo Container.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/samba3rpc.c8
-rw-r--r--source4/torture/rpc/spoolss.c35
-rw-r--r--source4/torture/rpc/spoolss_access.c4
-rw-r--r--source4/torture/rpc/spoolss_win.c8
4 files changed, 27 insertions, 28 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index c19476d9bf..f7c76743aa 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2804,8 +2804,8 @@ static bool torture_samba3_rpc_spoolss(struct torture_context *torture)
servername);
r.in.datatype = NULL;
r.in.access_mask = 0;
- r.in.level = 1;
- r.in.userlevel.level1 = &userlevel1;
+ r.in.userlevel_ctr.level = 1;
+ r.in.userlevel_ctr.user_info.level1 = &userlevel1;
r.out.handle = &server_handle;
torture_assert_ntstatus_ok(torture,
@@ -2836,8 +2836,8 @@ static bool torture_samba3_rpc_spoolss(struct torture_context *torture)
torture, "\\\\%s\\%s", servername, printers[0]);
r.in.datatype = NULL;
r.in.access_mask = 0;
- r.in.level = 1;
- r.in.userlevel.level1 = &userlevel1;
+ r.in.userlevel_ctr.level = 1;
+ r.in.userlevel_ctr.user_info.level1 = &userlevel1;
r.out.handle = &printer_handle;
torture_assert_ntstatus_ok(torture,
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index b1229ac3aa..064d3b434d 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -5777,8 +5777,8 @@ static bool test_OpenPrinter_badname(struct torture_context *tctx,
opEx.in.datatype = NULL;
opEx.in.devmode_ctr.devmode = NULL;
opEx.in.access_mask = 0;
- opEx.in.level = 1;
- opEx.in.userlevel.level1 = NULL;
+ opEx.in.userlevel_ctr.level = 1;
+ opEx.in.userlevel_ctr.user_info.level1 = NULL;
opEx.out.handle = &handle;
torture_comment(tctx, "Testing OpenPrinterEx(%s) with bad name\n", opEx.in.printername);
@@ -5887,8 +5887,7 @@ static bool test_OpenPrinterEx(struct torture_context *tctx,
const char *datatype,
struct spoolss_DeviceMode *devmode,
uint32_t access_mask,
- uint32_t level,
- union spoolss_UserLevel *userlevel,
+ struct spoolss_UserLevelCtr *userlevel_ctr,
struct policy_handle *handle,
WERROR expected_result)
{
@@ -5898,8 +5897,7 @@ static bool test_OpenPrinterEx(struct torture_context *tctx,
r.in.datatype = datatype;
r.in.devmode_ctr.devmode= devmode;
r.in.access_mask = access_mask;
- r.in.level = level;
- r.in.userlevel = *userlevel;
+ r.in.userlevel_ctr = *userlevel_ctr;
r.out.handle = handle;
torture_comment(tctx, "Testing OpenPrinterEx(%s)\n", r.in.printername);
@@ -5920,7 +5918,7 @@ static bool call_OpenPrinterEx(struct torture_context *tctx,
struct spoolss_DeviceMode *devmode,
struct policy_handle *handle)
{
- union spoolss_UserLevel userlevel;
+ struct spoolss_UserLevelCtr userlevel_ctr;
struct spoolss_UserLevel1 userlevel1;
struct dcerpc_binding_handle *b = p->binding_handle;
@@ -5932,12 +5930,12 @@ static bool call_OpenPrinterEx(struct torture_context *tctx,
userlevel1.minor = 3;
userlevel1.processor = 4;
- userlevel.level1 = &userlevel1;
+ userlevel_ctr.level = 1;
+ userlevel_ctr.user_info.level1 = &userlevel1;
return test_OpenPrinterEx(tctx, b, name, NULL, devmode,
SEC_FLAG_MAXIMUM_ALLOWED,
- 1,
- &userlevel,
+ &userlevel_ctr,
handle,
WERR_OK);
}
@@ -6041,7 +6039,7 @@ static bool test_openprinter(struct torture_context *tctx,
struct dcerpc_binding_handle *b,
const char *real_printername)
{
- union spoolss_UserLevel userlevel;
+ struct spoolss_UserLevelCtr userlevel_ctr;
struct policy_handle handle;
struct spoolss_UserLevel1 userlevel1;
const char *printername = NULL;
@@ -6119,13 +6117,14 @@ static bool test_openprinter(struct torture_context *tctx,
userlevel1.minor = 3;
userlevel1.processor = 4;
- userlevel.level1 = &userlevel1;
+ userlevel_ctr.level = 1;
+ userlevel_ctr.user_info.level1 = &userlevel1;
torture_comment(tctx, "Testing openprinterex printername pattern\n");
torture_assert(tctx,
- test_OpenPrinterEx(tctx, b, real_printername, NULL, NULL, 0, 1,
- &userlevel, &handle,
+ test_OpenPrinterEx(tctx, b, real_printername, NULL, NULL, 0,
+ &userlevel_ctr, &handle,
WERR_OK),
"OpenPrinterEx failed");
test_ClosePrinter(tctx, b, &handle);
@@ -6137,8 +6136,8 @@ static bool test_openprinter(struct torture_context *tctx,
tests[i].suffix);
torture_assert(tctx,
- test_OpenPrinterEx(tctx, b, printername, NULL, NULL, 0, 1,
- &userlevel, &handle,
+ test_OpenPrinterEx(tctx, b, printername, NULL, NULL, 0,
+ &userlevel_ctr, &handle,
tests[i].expected_result),
"OpenPrinterEx failed");
if (W_ERROR_IS_OK(tests[i].expected_result)) {
@@ -7335,8 +7334,8 @@ static bool test_architecture_buffer(struct torture_context *tctx,
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.in.userlevel_ctr.level = 1;
+ r.in.userlevel_ctr.user_info.level1 = &u1;
r.out.handle = &handle;
torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_OpenPrinterEx_r(b, tctx, &r), "");
diff --git a/source4/torture/rpc/spoolss_access.c b/source4/torture/rpc/spoolss_access.c
index a935cbd3c3..411dac1fdc 100644
--- a/source4/torture/rpc/spoolss_access.c
+++ b/source4/torture/rpc/spoolss_access.c
@@ -83,8 +83,8 @@ static bool test_openprinter_handle(struct torture_context *tctx,
r.in.datatype = NULL;
r.in.devmode_ctr.devmode= NULL;
r.in.access_mask = access_mask;
- r.in.level = 1;
- r.in.userlevel.level1 = &level1;
+ r.in.userlevel_ctr.level = 1;
+ r.in.userlevel_ctr.user_info.level1 = &level1;
r.out.handle = handle;
torture_comment(tctx, "Testing OpenPrinterEx(%s) with access_mask 0x%08x (%s)\n",
diff --git a/source4/torture/rpc/spoolss_win.c b/source4/torture/rpc/spoolss_win.c
index 96c3a2455d..bda0f3a832 100644
--- a/source4/torture/rpc/spoolss_win.c
+++ b/source4/torture/rpc/spoolss_win.c
@@ -54,8 +54,8 @@ static bool test_OpenPrinterEx(struct torture_context *tctx,
op.in.datatype = NULL;
op.in.devmode_ctr.devmode = NULL;
op.in.access_mask = access_mask;
- op.in.level = 1;
- op.in.userlevel.level1 = &ul_1;
+ op.in.userlevel_ctr.level = 1;
+ op.in.userlevel_ctr.user_info.level1 = &ul_1;
op.out.handle = handle;
ul_1.size = 1234;
@@ -95,8 +95,8 @@ static bool test_OpenPrinterAsAdmin(struct torture_context *tctx,
op.in.datatype = NULL;
op.in.devmode_ctr.devmode = NULL;
op.in.access_mask = SERVER_ALL_ACCESS;
- op.in.level = 1;
- op.in.userlevel.level1 = &ul_1;
+ op.in.userlevel_ctr.level = 1;
+ op.in.userlevel_ctr.user_info.level1 = &ul_1;
op.out.handle = &handle;
cp.in.handle = &handle;