s4-smbtorture: try more combinations to find printers in test_EnumPrinters_findname().
authorGünther Deschner <gd@samba.org>
Thu, 18 Feb 2010 00:43:08 +0000 (01:43 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 18 Feb 2010 00:48:52 +0000 (01:48 +0100)
Also take a note of servers returning full UNC printer paths although we did not
set the servername.

Guenther

source4/torture/rpc/spoolss.c

index f57ffe527d4a47b72fa76bbfbce3f7f4c1eb00e8..4c8ba0c0f51a1a76702e88bd4a92f6390cac9158 100644 (file)
@@ -3886,6 +3886,7 @@ static bool test_EnumPrinters_findname(struct torture_context *tctx,
        for (i=0; i < count; i++) {
 
                const char *current = NULL;
+               const char *p;
 
                switch (level) {
                case 1:
@@ -3897,6 +3898,19 @@ static bool test_EnumPrinters_findname(struct torture_context *tctx,
                        *found = true;
                        break;
                }
+
+               p = strrchr(current, '\\');
+               if (p) {
+                       if (!e.in.server) {
+                               torture_warning(tctx,
+                                       "server returns printername %s incl. servername although we did not set servername", current);
+                       }
+                       p++;
+                       if (strequal(p, name)) {
+                               *found = true;
+                               break;
+                       }
+               }
        }
 
        return true;