diff options
author | Gerald Carter <jerry@samba.org> | 2001-11-28 21:51:11 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2001-11-28 21:51:11 +0000 |
commit | bd8e916cb520d89a14a1cd13b2b261253729ac9b (patch) | |
tree | 3e7a728e8825d3c1acfdcbec8306c60b0bb8d724 /source3/rpc_server | |
parent | 7d2d605f0db0c3689a263d6857721eac66a1b9c1 (diff) | |
download | samba-bd8e916cb520d89a14a1cd13b2b261253729ac9b.tar.gz samba-bd8e916cb520d89a14a1cd13b2b261253729ac9b.tar.bz2 samba-bd8e916cb520d89a14a1cd13b2b261253729ac9b.zip |
merge from APPLIANCE_HEAD
(This used to be commit c60aa6c06f376684b6d6d9a2c14305ca9f4657ef)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 71b776f80a..3b21726a0f 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2959,13 +2959,14 @@ static WERROR enum_all_printers_info_1_local(NEW_BUFFER *buffer, uint32 offered, *********************************************************************/ static WERROR enum_all_printers_info_1_name(fstring name, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { - fstring temp; + char *s = name; + DEBUG(4,("enum_all_printers_info_1_name\n")); - fstrcpy(temp, "\\\\"); - fstrcat(temp, global_myname); + if ((name[0] == '\\') && (name[1] == '\\')) + s = name + 2; - if (strequal(name, temp)) { + if (is_myname_or_ipaddr(s)) { return enum_all_printers_info_1(PRINTER_ENUM_ICON8, buffer, offered, needed, returned); } else @@ -3131,20 +3132,16 @@ static WERROR enumprinters_level2( uint32 flags, fstring servername, NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned) { - fstring temp; - - fstrcpy(temp, "\\\\"); - fstrcat(temp, global_myname); + char *s = servername; if (flags & PRINTER_ENUM_LOCAL) { - if (strequal(servername, temp)) - return enum_all_printers_info_2(buffer, offered, needed, returned); - else return enum_all_printers_info_2(buffer, offered, needed, returned); } if (flags & PRINTER_ENUM_NAME) { - if (strequal(servername, temp)) + if ((servername[0] == '\\') && (servername[1] == '\\')) + s = servername + 2; + if (is_myname_or_ipaddr(s)) return enum_all_printers_info_2(buffer, offered, needed, returned); else return WERR_INVALID_NAME; |