diff options
-rw-r--r-- | source3/smbd/reply.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 28a3f2d1c1..72fee8cee1 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -39,6 +39,7 @@ #include "libsmb/nmblib.h" #include "auth.h" #include "smbprofile.h" +#include "../lib/tsocket/tsocket.h" /**************************************************************************** Ensure we check the path in *exactly* the same way as W2K for a findfirst/findnext @@ -572,7 +573,15 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb */ if (strequal(name1, "*SMBSERVER ") || strequal(name1, "*SMBSERV ")) { - fstrcpy(name1, sconn->client_id.addr); + char *raddr; + + raddr = tsocket_address_inet_addr_string(sconn->remote_address, + talloc_tos()); + if (raddr == NULL) { + exit_server_cleanly("could not allocate raddr"); + } + + fstrcpy(name1, raddr); } set_local_machine_name(name1, True); |