]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fix a bug in printer name handling that jerry reported.
authorJean-François Micouleau <jfm@samba.org>
Fri, 27 Apr 2001 17:08:33 +0000 (17:08 +0000)
committerJean-François Micouleau <jfm@samba.org>
Fri, 27 Apr 2001 17:08:33 +0000 (17:08 +0000)
names can be \\server -> print server
\\server\printer -> printer
printer -> printer

J.F.

source/rpc_server/srv_spoolss_nt.c

index 57f95873fc255795d93e2cc3d7a2fd2b351f60d3..6dbf90ba8a528d056f8d6f4e84e199d24c3804c4 100644 (file)
@@ -371,7 +371,7 @@ static BOOL set_printer_hnd_printertype(Printer_entry *Printer, char *handlename
        }
 
        /* it's a print server */
-       if (!strchr(handlename+2, '\\')) {
+       if (*handlename=='\\' && *(handlename+1)=='\\' && !strchr(handlename+2, '\\')) {
                DEBUGADD(4,("Printer is a print server\n"));
                Printer->printer_type = PRINTER_HANDLE_IS_PRINTSERVER;          
        }
@@ -407,8 +407,13 @@ static BOOL set_printer_hnd_name(Printer_entry *Printer, char *handlename)
        if (Printer->printer_type!=PRINTER_HANDLE_IS_PRINTER)
                return False;
        
-       aprinter=strchr(handlename+2, '\\');
-       aprinter++;
+       if (*handlename=='\\') {
+               aprinter=strchr(handlename+2, '\\');
+               aprinter++;
+       }
+       else {
+               aprinter=handlename;
+       }
 
        DEBUGADD(5,("searching for [%s] (len=%d)\n", aprinter, strlen(aprinter)));