s4-torture: Fixed spoolss dsspooler printername test.
authorAndreas Schneider <asn@samba.org>
Fri, 30 Apr 2010 12:38:07 +0000 (14:38 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 4 May 2010 17:38:05 +0000 (19:38 +0200)
Signed-off-by: Günther Deschner <gd@samba.org>
source4/torture/rpc/spoolss.c

index bb114b658a5afaea2391c17926bd8dea6d5f9257..cb15ffd5e3828c612dfaf10ccc17ce6fb670086d 100644 (file)
@@ -4972,6 +4972,7 @@ static bool test_PrinterData_DsSpooler(struct torture_context *tctx,
        union spoolss_SetPrinterInfo sinfo;
        union spoolss_PrinterInfo info;
        struct dcerpc_binding_handle *b = p->binding_handle;
+       const char *pname;
 
        ZERO_STRUCT(info_ctr);
        ZERO_STRUCT(devmode_ctr);
@@ -5061,7 +5062,14 @@ do {\
        TEST_SZ("description", info.info2.comment);
        TEST_SZ("driverName", info.info2.drivername);
        TEST_SZ("location", info.info2.location);
-       TEST_SZ("printerName", info.info2.printername);
+
+       pname = strrchr(info.info2.printername, '\\');
+       if (pname == NULL) {
+               pname = info.info2.printername;
+       } else {
+               pname++;
+       }
+       TEST_SZ("printerName", pname);
        /* TEST_SZ("printSeparatorFile", info.info2.sepfile); */
        /* TEST_SZ("printShareName", info.info2.sharename); */