summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-06 12:25:47 +0100
committerGünther Deschner <gd@samba.org>2009-02-06 14:59:21 +0100
commitb970eb791cdf8893881bab3c113fdd5f2ff9866e (patch)
tree3ebee63782452422c328b61927aac2b86e0b307b
parent8153916f4aad1482351719ed2f1d91d48fe89197 (diff)
downloadsamba-b970eb791cdf8893881bab3c113fdd5f2ff9866e.tar.gz
samba-b970eb791cdf8893881bab3c113fdd5f2ff9866e.tar.bz2
samba-b970eb791cdf8893881bab3c113fdd5f2ff9866e.zip
s4-smbtorture: fix test_GetPrinter.
Guenther
-rw-r--r--source4/torture/rpc/samba3rpc.c6
-rw-r--r--source4/torture/rpc/spoolss_win.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 5b493db813..d4bcb4919c 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2668,6 +2668,7 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
struct spoolss_GetPrinter r;
DATA_BLOB blob;
NTSTATUS status;
+ uint32_t needed;
mem_ctx = talloc_new(ctx);
if (mem_ctx == NULL) {
@@ -2678,6 +2679,7 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
+ r.out.needed = &needed;
status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -2697,14 +2699,14 @@ static NTSTATUS getprinterinfo(TALLOC_CTX *ctx, struct dcerpc_pipe *pipe,
r.in.handle = handle;
r.in.level = level;
- blob = data_blob_talloc(mem_ctx, NULL, r.out.needed);
+ blob = data_blob_talloc(mem_ctx, NULL, needed);
if (blob.data == NULL) {
talloc_free(mem_ctx);
return NT_STATUS_NO_MEMORY;
}
memset(blob.data, 0, blob.length);
r.in.buffer = &blob;
- r.in.offered = r.out.needed;
+ r.in.offered = needed;
status = dcerpc_spoolss_GetPrinter(pipe, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
diff --git a/source4/torture/rpc/spoolss_win.c b/source4/torture/rpc/spoolss_win.c
index ca61d1dddb..d7496d007a 100644
--- a/source4/torture/rpc/spoolss_win.c
+++ b/source4/torture/rpc/spoolss_win.c
@@ -220,6 +220,7 @@ static bool test_GetPrinter(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_GetPrinter gp;
DATA_BLOB blob = data_blob_talloc_zero(ctx, initial_blob_size);
+ uint32_t needed;
torture_comment(tctx, "Test GetPrinter level %d\n", level);
@@ -227,14 +228,15 @@ static bool test_GetPrinter(struct torture_context *tctx,
gp.in.level = level;
gp.in.buffer = (initial_blob_size == 0)?NULL:&blob;
gp.in.offered = initial_blob_size;
+ gp.out.needed = &needed;
status = dcerpc_spoolss_GetPrinter(p, tctx, &gp);
torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
if (W_ERROR_EQUAL(gp.out.result, WERR_INSUFFICIENT_BUFFER)) {
- blob = data_blob_talloc_zero(ctx, gp.out.needed);
+ blob = data_blob_talloc_zero(ctx, needed);
gp.in.buffer = &blob;
- gp.in.offered = gp.out.needed;
+ gp.in.offered = needed;
status = dcerpc_spoolss_GetPrinter(p, tctx, &gp);
torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
}