diff options
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-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; |