diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-10-17 14:59:30 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-10-19 12:14:57 +0200 |
commit | 980191d189ee1f5a25e74a6bdf141d4c7e4455d5 (patch) | |
tree | 6f714b6f446de7b7f8487944d47a14a8106a8eb7 /source3/smbd | |
parent | 1de9e714756b65b1e15fae044bde065bb2572b16 (diff) | |
download | samba-980191d189ee1f5a25e74a6bdf141d4c7e4455d5.tar.gz samba-980191d189ee1f5a25e74a6bdf141d4c7e4455d5.tar.bz2 samba-980191d189ee1f5a25e74a6bdf141d4c7e4455d5.zip |
s3:smbd: update sconn->remote_hostname after the netbios session request
Also update the info in the new smbXsrv structure.
This way we can log the remote name in status outputs.
metze
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 1b4a1620d6..4423e8e190 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -590,6 +590,19 @@ void reply_special(struct smbd_server_connection *sconn, char *inbuf, size_t inb set_local_machine_name(name1, True); set_remote_machine_name(name2, True); + if (is_ipaddress(sconn->remote_hostname)) { + char *p = discard_const_p(char, sconn->remote_hostname); + + talloc_free(p); + + sconn->remote_hostname = talloc_strdup(sconn, + get_remote_machine_name()); + if (sconn->remote_hostname == NULL) { + exit_server_cleanly("could not copy remote name"); + } + sconn->conn->remote_hostname = sconn->remote_hostname; + } + DEBUG(2,("netbios connect: local=%s remote=%s, name type = %x\n", get_local_machine_name(), get_remote_machine_name(), name_type2)); |