summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-15 09:24:17 +0200
committerVolker Lendecke <vl@samba.org>2010-08-16 22:39:24 +0200
commita98604d7f281f890fefd23e23e887c2199842484 (patch)
treee95202c3b681d4a7cd12c050c8f23a829ef62c69
parent910e3df7dd10e43e058874002b60e452c13cfa18 (diff)
downloadsamba-a98604d7f281f890fefd23e23e887c2199842484.tar.gz
samba-a98604d7f281f890fefd23e23e887c2199842484.tar.bz2
samba-a98604d7f281f890fefd23e23e887c2199842484.zip
s3: Remove smbd_server_fd() from make_connection_snum
-rw-r--r--source3/smbd/service.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index d32e53a568..2bfed9deb5 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -650,7 +650,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
struct smb_filename *smb_fname_cpath = NULL;
fstring dev;
int ret;
- char addr[INET6_ADDRSTRLEN];
+ char *addr;
bool on_err_call_dis_hook = false;
bool claimed_connection = false;
uid_t effuid;
@@ -689,9 +689,16 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
add_session_user(sconn, conn->server_info->unix_name);
- safe_strcpy(conn->client_address,
- client_addr(smbd_server_fd(),addr,sizeof(addr)),
- sizeof(conn->client_address)-1);
+ addr = tsocket_address_inet_addr_string(sconn->remote_address,
+ talloc_tos());
+ if (addr == NULL) {
+ *pstatus = NT_STATUS_NO_MEMORY;
+ goto err_root_exit;
+ }
+ safe_strcpy(conn->client_address, addr,
+ sizeof(conn->client_address)-1);
+ TALLOC_FREE(addr);
+
conn->num_files_open = 0;
conn->lastused = conn->lastused_count = time(NULL);
conn->used = True;