From afe300cb527c19cffa8667db4772d0d5812c342b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 17:09:30 +0100 Subject: s4-smbtorture: fix spoolss enum tests. Guenther --- source4/torture/rpc/samba3rpc.c | 6 ++-- source4/torture/rpc/spoolss.c | 65 ++++++++++++++++++++++++++------------- source4/torture/rpc/spoolss_win.c | 14 ++++++--- 3 files changed, 58 insertions(+), 27 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index d4bcb4919c..5f803b07d3 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2617,12 +2617,14 @@ static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe, struct spoolss_EnumPrinters r; NTSTATUS status; DATA_BLOB blob; + uint32_t needed; r.in.flags = PRINTER_ENUM_LOCAL; r.in.server = talloc_asprintf(mem_ctx, "\\\\%s", servername); r.in.level = level; r.in.buffer = NULL; r.in.offered = 0; + r.out.needed = &needed; status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -2638,14 +2640,14 @@ static bool enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe, return false; } - blob = data_blob_talloc_zero(mem_ctx, r.out.needed); + blob = data_blob_talloc_zero(mem_ctx, needed); if (blob.data == NULL) { d_printf("(%s) data_blob_talloc failed\n", __location__); return false; } r.in.buffer = &blob; - r.in.offered = r.out.needed; + r.in.offered = needed; status = dcerpc_spoolss_EnumPrinters(pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index d0252d8d69..2592cc310d 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -106,11 +106,13 @@ static bool test_EnumPorts(struct torture_context *tctx, for (i=0;i