From 6309f7b9505d1de60ef01a7129e2d6022cdc8b9d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 5 Jun 2010 01:26:49 +0200 Subject: s4-smbtorture: make RPC-SPOOLSS-ACCESS more compatible with older samba releases. Guenther --- source4/torture/rpc/spoolss_access.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/spoolss_access.c b/source4/torture/rpc/spoolss_access.c index f86c2e3dcb..812a280e9e 100644 --- a/source4/torture/rpc/spoolss_access.c +++ b/source4/torture/rpc/spoolss_access.c @@ -357,7 +357,7 @@ static bool spoolss_access_setup_sd(struct torture_context *tctx, } static bool test_EnumPrinters_findone(struct torture_context *tctx, - struct dcerpc_binding_handle *b, + struct dcerpc_pipe *p, const char **printername) { struct spoolss_EnumPrinters r; @@ -365,11 +365,12 @@ static bool test_EnumPrinters_findone(struct torture_context *tctx, union spoolss_PrinterInfo *info; uint32_t needed; int i; + struct dcerpc_binding_handle *b = p->binding_handle; *printername = NULL; r.in.flags = PRINTER_ENUM_LOCAL; - r.in.server = NULL; + r.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.level = 1; r.in.buffer = NULL; r.in.offered = 0; @@ -414,9 +415,11 @@ static bool torture_rpc_spoolss_access_setup_common(struct torture_context *tctx const char *printername; const char *binding = torture_setting_string(tctx, "binding", NULL); - testuser = torture_create_testuser(tctx, t->user.username, - torture_setting_string(tctx, "workgroup", NULL), - ACB_NORMAL, &testuser_passwd); + testuser = torture_create_testuser_max_pwlen(tctx, t->user.username, + torture_setting_string(tctx, "workgroup", NULL), + ACB_NORMAL, + &testuser_passwd, + 32); if (!testuser) { torture_fail(tctx, "Failed to create test user"); } @@ -464,7 +467,7 @@ static bool torture_rpc_spoolss_access_setup_common(struct torture_context *tctx "Error connecting to server"); torture_assert(tctx, - test_EnumPrinters_findone(tctx, spoolss_pipe->binding_handle, &printername), + test_EnumPrinters_findone(tctx, spoolss_pipe, &printername), "failed to enumerate printers"); if (t->user.sd) { -- cgit