1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Stefan Metzmacher 2012-10-17 14:59:30 +02:00 committed by Michael Adam
parent 1de9e71475
commit 980191d189

View File

@ -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));