summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/samba3rpc.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 1e859e1ff8..8bfbad22e5 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2230,7 +2230,7 @@ static NTSTATUS find_printers(TALLOC_CTX *ctx, struct smbcli_tree *tree,
}
static BOOL enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe,
- int level)
+ int level, int *num_printers)
{
struct spoolss_EnumPrinters r;
NTSTATUS status;
@@ -2273,6 +2273,8 @@ static BOOL enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe,
return False;
}
+ *num_printers = r.out.count;
+
return True;
}
@@ -2506,10 +2508,20 @@ BOOL torture_samba3_rpc_spoolss(struct torture_context *torture)
}
}
- if (!enumprinters(mem_ctx, p, 1)) {
- d_printf("(%s) enumprinters failed\n", __location__);
- talloc_free(mem_ctx);
- return False;
+ {
+ int num_enumerated;
+ if (!enumprinters(mem_ctx, p, 1, &num_enumerated)) {
+ d_printf("(%s) enumprinters failed\n", __location__);
+ talloc_free(mem_ctx);
+ return False;
+ }
+ if (num_printers != num_enumerated) {
+ d_printf("(%s) netshareenum gave %d printers, "
+ "enumprinters gave %d\n", __location__,
+ num_printers, num_enumerated);
+ talloc_free(mem_ctx);
+ return False;
+ }
}
talloc_free(mem_ctx);