diff options
author | Günther Deschner <gd@samba.org> | 2010-02-17 20:45:26 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-02-18 01:48:36 +0100 |
commit | 57847c2fee1a19c388ab84f5c629212f70cde62d (patch) | |
tree | 92dd8a65847765f08cdbfd51875e84d533a2d560 /source4 | |
parent | d5e30dec8bbc695d640df335a83554f1666907b5 (diff) | |
download | samba-57847c2fee1a19c388ab84f5c629212f70cde62d.tar.gz samba-57847c2fee1a19c388ab84f5c629212f70cde62d.tar.bz2 samba-57847c2fee1a19c388ab84f5c629212f70cde62d.zip |
s4-smbtorture: avoid potential loop while adding a new printer in RPC-SPOOLSS-PRINTER.
Guenther
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 0c9c076fda..82469e9ef3 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -4030,6 +4030,7 @@ static bool test_AddPrinter_normal(struct torture_context *tctx, struct spoolss_UserLevelCtr userlevel_ctr; struct policy_handle handle; bool found = false; + bool existing_printer_deleted = false; ZERO_STRUCT(devmode_ctr); ZERO_STRUCT(secdesc_ctr); @@ -4078,6 +4079,10 @@ static bool test_AddPrinter_normal(struct torture_context *tctx, if (W_ERROR_EQUAL(result, WERR_PRINTER_ALREADY_EXISTS)) { struct policy_handle printer_handle; + if (existing_printer_deleted) { + torture_fail(tctx, "already deleted printer still existing?"); + } + torture_assert(tctx, call_OpenPrinterEx(tctx, p, printername, NULL, &printer_handle), "failed to open printer handle"); @@ -4087,6 +4092,8 @@ static bool test_AddPrinter_normal(struct torture_context *tctx, torture_assert(tctx, test_ClosePrinter(tctx, p, &printer_handle), "failed to close server handle"); + existing_printer_deleted = true; + goto again; } |