summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
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
commit30c0777c1f5cd6953f8e0f279458c73700a206b9 (patch)
tree83d3896a93891654d212dc39f9710797d303b2b0 /source3/rpc_server/srv_spoolss_nt.c
parent9872e1320c3b1606676f607041ff38b1d95e4332 (diff)
downloadsamba-30c0777c1f5cd6953f8e0f279458c73700a206b9.tar.gz
samba-30c0777c1f5cd6953f8e0f279458c73700a206b9.tar.bz2
samba-30c0777c1f5cd6953f8e0f279458c73700a206b9.zip
fix a bug in printer name handling that jerry reported.
names can be \\server -> print server \\server\printer -> printer printer -> printer J.F. (This used to be commit ec576722b79e3c5384dd40c532d4233dd6b1b9a8)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 57f95873fc..6dbf90ba8a 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/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)));