mirror of
https://github.com/samba-team/samba.git
synced 2025-01-04 05:18:06 +03:00
fix a bug in printer name handling that jerry reported.
names can be \\server -> print server \\server\printer -> printer printer -> printer J.F.
This commit is contained in:
parent
fcd100eec5
commit
ec576722b7
@ -371,7 +371,7 @@ static BOOL set_printer_hnd_printertype(Printer_entry *Printer, char *handlename
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* it's a print server */
|
/* it's a print server */
|
||||||
if (!strchr(handlename+2, '\\')) {
|
if (*handlename=='\\' && *(handlename+1)=='\\' && !strchr(handlename+2, '\\')) {
|
||||||
DEBUGADD(4,("Printer is a print server\n"));
|
DEBUGADD(4,("Printer is a print server\n"));
|
||||||
Printer->printer_type = PRINTER_HANDLE_IS_PRINTSERVER;
|
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)
|
if (Printer->printer_type!=PRINTER_HANDLE_IS_PRINTER)
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
aprinter=strchr(handlename+2, '\\');
|
if (*handlename=='\\') {
|
||||||
aprinter++;
|
aprinter=strchr(handlename+2, '\\');
|
||||||
|
aprinter++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aprinter=handlename;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUGADD(5,("searching for [%s] (len=%d)\n", aprinter, strlen(aprinter)));
|
DEBUGADD(5,("searching for [%s] (len=%d)\n", aprinter, strlen(aprinter)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user