s4-smbtorture: use printerinfo level 1 name, not description in
authorGünther Deschner <gd@samba.org>
Mon, 13 Apr 2009 12:48:32 +0000 (14:48 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 13 Apr 2009 14:10:50 +0000 (16:10 +0200)
test_EnumPrinters_old().

Guenther

source4/torture/rpc/spoolss.c

index 2bdcc3fdaf7eff71b9f03019ad421275803ce3de..f2a503b6fdf9b3a0190ff8ec7fb3598e5c5a9b16 100644 (file)
@@ -1816,10 +1816,17 @@ static bool test_EnumPrinters_old(struct torture_context *tctx, struct dcerpc_pi
 
                for (j=0;j<count;j++) {
                        if (r.in.level == 1) {
-                               /* the names appear to be comma-separated name lists? */
-                               char *name = talloc_strdup(tctx, info[j].info1.name);
-                               char *comma = strchr(name, ',');
-                               if (comma) *comma = 0;
+                               char *unc = talloc_strdup(tctx, info[j].info1.name);
+                               char *slash, *name;
+                               name = unc;
+                               if (unc[0] == '\\' && unc[1] == '\\') {
+                                       unc +=2;
+                               }
+                               slash = strchr(unc, '\\');
+                               if (slash) {
+                                       slash++;
+                                       name = slash;
+                               }
                                if (!test_OpenPrinter(tctx, p, name)) {
                                        ret = false;
                                }