summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2001-04-27 17:08:33 +0000
committerJean-François Micouleau <jfm@samba.org>2001-04-27 17:08:33 +0000
commitec576722b79e3c5384dd40c532d4233dd6b1b9a8 (patch)
treeacc7a220cbd8a29fffd5292d8f453d2b7140ccb1
parentfcd100eec51034cc4ea1e781e971b6dd65801b31 (diff)
downloadsamba-ec576722b79e3c5384dd40c532d4233dd6b1b9a8.tar.gz
samba-ec576722b79e3c5384dd40c532d4233dd6b1b9a8.tar.xz
samba-ec576722b79e3c5384dd40c532d4233dd6b1b9a8.zip
fix a bug in printer name handling that jerry reported.
names can be \\server -> print server \\server\printer -> printer printer -> printer J.F.
-rw-r--r--source/rpc_server/srv_spoolss_nt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index 57f95873fc2..6dbf90ba8a5 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -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)));