From ae05a7aec62d9ffcb02ee17d0f5f18e1e7ab1803 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 16 Jun 2011 15:45:18 +0200 Subject: s3-smbd: Replace client_id in smbd reply. Signed-off-by: Andrew Bartlett --- source3/smbd/reply.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/smbd/reply.c') 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); -- cgit