From 53382d54f4e98d49dd447da85d1978df632045ea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 20 Jan 2004 06:10:15 +0000 Subject: check for the correct fault code when the server fails a use of a incorrect policy handle (This used to be commit 8cd6e90eb8716ba43f5940245d7be580aab4ba83) --- source4/torture/rpc/spoolss.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 5b118bec7b..08c486f45a 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -578,6 +578,7 @@ static BOOL test_SecondaryClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct { NTSTATUS status; struct dcerpc_pipe *p2; + BOOL ret = True; /* only makes sense on SMB */ if (p->transport.transport != NCACN_NP) { @@ -597,13 +598,18 @@ static BOOL test_SecondaryClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct if (test_ClosePrinter(p2, mem_ctx, handle)) { printf("ERROR: Allowed close on secondary connection!\n"); - dcerpc_pipe_close(p2); - return False; + ret = False; + } + + if (p2->last_fault_code != DCERPC_FAULT_CONTEXT_MISMATCH) { + printf("Unexpected fault code 0x%x - expected 0x%x\n", + p2->last_fault_code, DCERPC_FAULT_CONTEXT_MISMATCH); + ret = False; } dcerpc_pipe_close(p2); - return True; + return ret; } static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, -- cgit