summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-04-27 16:05:08 +0200
committerStefan Metzmacher <metze@samba.org>2010-04-27 16:18:14 +0200
commit9dd4419ebe12d8a4eb467cf26640de5575e04e83 (patch)
tree968185f56933223a646c6ee90364ee85db0f99ec /source4/smb_server
parent54abb0724b5577eb7a9a132f647649dc30931b18 (diff)
downloadsamba-9dd4419ebe12d8a4eb467cf26640de5575e04e83.tar.gz
samba-9dd4419ebe12d8a4eb467cf26640de5575e04e83.tar.bz2
samba-9dd4419ebe12d8a4eb467cf26640de5575e04e83.zip
s4:smb_server: use tsocket_address_string() for debugging the client address
metze
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/management.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source4/smb_server/management.c b/source4/smb_server/management.c
index e58c278613..b8e42aec40 100644
--- a/source4/smb_server/management.c
+++ b/source4/smb_server/management.c
@@ -25,6 +25,7 @@
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_irpc.h"
#include "auth/auth.h"
+#include "lib/tsocket/tsocket.h"
/*
return a list of open sessions
@@ -34,9 +35,15 @@ static NTSTATUS smbsrv_session_information(struct irpc_message *msg,
{
struct smbsrv_connection *smb_conn = talloc_get_type(msg->private_data,
struct smbsrv_connection);
+ struct tsocket_address *client_addr = smb_conn->connection->remote_address;
+ char *client_addr_string;
int i=0, count=0;
struct smbsrv_session *sess;
+ /* This is for debugging only! */
+ client_addr_string = tsocket_address_string(client_addr, r);
+ NT_STATUS_HAVE_NO_MEMORY(client_addr_string);
+
/* count the number of sessions */
for (sess=smb_conn->sessions.list; sess; sess=sess->next) {
count++;
@@ -48,14 +55,8 @@ static NTSTATUS smbsrv_session_information(struct irpc_message *msg,
for (sess=smb_conn->sessions.list; sess; sess=sess->next) {
struct smbsrv_session_info *info = &r->out.info.sessions.sessions[i];
- struct socket_address *client_addr;
- client_addr = socket_get_peer_addr(smb_conn->connection->socket, r);
-
- if (client_addr) {
- info->client_ip = client_addr->addr;
- } else {
- info->client_ip = NULL;
- }
+
+ info->client_ip = client_addr_string;
info->vuid = sess->vuid;
info->account_name = sess->session_info->server_info->account_name;