summaryrefslogtreecommitdiffstats
path: root/source4/smb_server/sesssetup.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-09-22 23:50:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:04 -0500
commit79ae828819193dd9ed5e060f78a88752e30bd1c3 (patch)
tree81ac23f5eb10cb52ef081be59723a8c28fa46d51 /source4/smb_server/sesssetup.c
parent3fb57e31a0f1e4851dcd1f4e6d87fc320f6fa703 (diff)
downloadsamba-79ae828819193dd9ed5e060f78a88752e30bd1c3.tar.gz
samba-79ae828819193dd9ed5e060f78a88752e30bd1c3.tar.xz
samba-79ae828819193dd9ed5e060f78a88752e30bd1c3.zip
r2542: I really don't like the 'substitute' code, and I particularly don't
like it in the mainline code (outside the smb.conf magic). We will need to have a more useful 'helper' routine for this, but for now we at least get a reliable IP address. Also remove the unused 'socket' structure in the smb server - it seems to have been replaced by the socket library. Andrew Bartlett (This used to be commit d8fd19a2020da6cce691c0db2b00f42e31d672cc)
Diffstat (limited to 'source4/smb_server/sesssetup.c')
-rw-r--r--source4/smb_server/sesssetup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source4/smb_server/sesssetup.c b/source4/smb_server/sesssetup.c
index 88777d9673..f9b2eee1b2 100644
--- a/source4/smb_server/sesssetup.c
+++ b/source4/smb_server/sesssetup.c
@@ -45,14 +45,23 @@ static NTSTATUS sesssetup_old(struct smbsrv_request *req, union smb_sesssetup *s
struct auth_serversupplied_info *server_info = NULL;
struct auth_session_info *session_info;
+ TALLOC_CTX *mem_ctx = talloc_init("NT1 session setup");
+ char *remote_machine;
+ if (!mem_ctx) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
if (!req->smb_conn->negotiate.done_sesssetup) {
req->smb_conn->negotiate.max_send = sess->old.in.bufsize;
}
-
+
+ remote_machine = socket_get_peer_addr(req->smb_conn->connection->socket, mem_ctx);
status = make_user_info_for_reply_enc(&user_info,
sess->old.in.user, sess->old.in.domain,
+ remote_machine,
sess->old.in.password,
data_blob(NULL, 0));
+ talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_ACCESS_DENIED;
}
@@ -122,10 +131,18 @@ static NTSTATUS sesssetup_nt1(struct smbsrv_request *req, union smb_sesssetup *s
free_auth_context(&auth_context);
} else {
+ TALLOC_CTX *mem_ctx = talloc_init("NT1 session setup");
+ char *remote_machine;
+ if (!mem_ctx) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ remote_machine = socket_get_peer_addr(req->smb_conn->connection->socket, mem_ctx);
status = make_user_info_for_reply_enc(&user_info,
sess->nt1.in.user, sess->nt1.in.domain,
+ remote_machine,
sess->nt1.in.password1,
sess->nt1.in.password2);
+ talloc_free(mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_ACCESS_DENIED;
}