summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-16 14:29:36 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-07-04 18:28:18 +1000
commitd99acd26a2ecee17edf8739990dd67ef659182b1 (patch)
tree41fc13facc53d68c301ea6bf42bb2e8bbf8c7d9b
parenta513086c2a231f1e6b2e74dd007e7158a07e47a6 (diff)
downloadsamba-d99acd26a2ecee17edf8739990dd67ef659182b1.tar.gz
samba-d99acd26a2ecee17edf8739990dd67ef659182b1.tar.bz2
samba-d99acd26a2ecee17edf8739990dd67ef659182b1.zip
s3-smbd: Replace client_id in smbd connection.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source3/smbd/connection.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 7ed9518756..048604c5c9 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -22,6 +22,7 @@
#include "smbd/globals.h"
#include "dbwrap.h"
#include "auth.h"
+#include "../lib/tsocket/tsocket.h"
/****************************************************************************
Delete a connection record.
@@ -137,6 +138,7 @@ bool claim_connection(connection_struct *conn, const char *name)
{
struct db_record *rec;
struct connections_data crec;
+ char *raddr;
TDB_DATA dbuf;
NTSTATUS status;
@@ -158,8 +160,14 @@ bool claim_connection(connection_struct *conn, const char *name)
sizeof(crec.servicename));
crec.start = time(NULL);
+ raddr = tsocket_address_inet_addr_string(conn->sconn->remote_address,
+ talloc_tos());
+ if (raddr == NULL) {
+ return false;
+ }
+
strlcpy(crec.machine,get_remote_machine_name(),sizeof(crec.machine));
- strlcpy(crec.addr, conn->sconn->client_id.addr, sizeof(crec.addr));
+ strlcpy(crec.addr, raddr, sizeof(crec.addr));
dbuf.dptr = (uint8 *)&crec;
dbuf.dsize = sizeof(crec);