summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-03 18:41:26 -0700
committerJeremy Allison <jra@samba.org>2007-11-03 18:41:26 -0700
commit25074433f412c4dd2531fd268d51be8753ddc11b (patch)
tree2c18dde9c017a675f2ea75e76ae773bb9057ded5 /source3/smbd
parent6658165d5e9cd186fea74e1581091233e8990e9b (diff)
downloadsamba-25074433f412c4dd2531fd268d51be8753ddc11b.tar.gz
samba-25074433f412c4dd2531fd268d51be8753ddc11b.tar.bz2
samba-25074433f412c4dd2531fd268d51be8753ddc11b.zip
I can't get away without a 'length' arg. :-).
Jeremy. (This used to be commit 95d01279a5def709d0a5d5ae7224d6286006d120)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/connection.c2
-rw-r--r--source3/smbd/process.c3
-rw-r--r--source3/smbd/server.c6
-rw-r--r--source3/smbd/service.c6
-rw-r--r--source3/smbd/session.c4
-rw-r--r--source3/smbd/sesssetup.c3
6 files changed, 15 insertions, 9 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 4b89668640..f041513820 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -152,7 +152,7 @@ bool claim_connection(connection_struct *conn, const char *name,
crec.bcast_msg_flags = msg_flags;
strlcpy(crec.machine,get_remote_machine_name(),sizeof(crec.machine));
- strlcpy(crec.addr,conn?conn->client_address:client_addr(addr),
+ strlcpy(crec.addr,conn?conn->client_address:client_addr(addr,sizeof(addr)),
sizeof(crec.addr));
dbuf.dptr = (uint8 *)&crec;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index f35e7054d7..24feac4630 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1471,7 +1471,8 @@ static void process_smb(char *inbuf, size_t nread, size_t unread_bytes)
lp_hostsdeny(-1))) {
/* send a negative session response "not listening on calling name" */
static unsigned char buf[5] = {0x83, 0, 0, 1, 0x81};
- DEBUG( 1, ( "Connection denied from %s\n", client_addr(addr) ) );
+ DEBUG( 1, ( "Connection denied from %s\n",
+ client_addr(addr,sizeof(addr)) ) );
(void)send_smb(smbd_server_fd(),(char *)buf);
exit_server_cleanly("connection denied");
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 34b3d4a32a..e77573b9c6 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -624,8 +624,10 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
/* this is needed so that we get decent entries
in smbstatus for port 445 connects */
- set_remote_machine_name(get_peer_addr(smbd_server_fd(),remaddr),
- False);
+ set_remote_machine_name(get_peer_addr(smbd_server_fd(),
+ remaddr,
+ sizeof(remaddr)),
+ false);
/* Reset the state of the random
* number generation system, so
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 2901cd3417..502fadedc7 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -758,7 +758,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
add_session_user(user);
- safe_strcpy(conn->client_address, client_addr(addr),
+ safe_strcpy(conn->client_address, client_addr(addr,sizeof(addr)),
sizeof(conn->client_address)-1);
conn->num_files_open = 0;
conn->lastused = conn->lastused_count = time(NULL);
@@ -1302,7 +1302,9 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password,
}
DEBUG(0,("%s (%s) couldn't find service %s\n",
- get_remote_machine_name(), client_addr(addr), service));
+ get_remote_machine_name(),
+ client_addr(addr,sizeof(addr)),
+ service));
*status = NT_STATUS_BAD_NETWORK_NAME;
return NULL;
}
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index 15154162b9..69f4a37c85 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -161,7 +161,7 @@ bool session_claim(user_struct *vuser)
hostname = client_name();
if (strcmp(hostname, "UNKNOWN") == 0) {
- hostname = client_addr(addr);
+ hostname = client_addr(addr,sizeof(addr));
}
fstrcpy(sessionid.username, vuser->user.unix_name);
@@ -171,7 +171,7 @@ bool session_claim(user_struct *vuser)
sessionid.uid = vuser->uid;
sessionid.gid = vuser->gid;
fstrcpy(sessionid.remote_machine, get_remote_machine_name());
- fstrcpy(sessionid.ip_addr_str, client_addr(addr));
+ fstrcpy(sessionid.ip_addr_str, client_addr(addr,sizeof(addr)));
sessionid.connect_start = time(NULL);
if (!smb_pam_claim_session(sessionid.username, sessionid.id_str,
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 35efbc009f..87cb3b435b 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -1317,7 +1317,8 @@ static void setup_new_vc_session(void)
#endif
if (lp_reset_on_zero_vc()) {
connections_forall(shutdown_other_smbds,
- CONST_DISCARD(void *,client_addr(addr)));
+ CONST_DISCARD(void *,
+ client_addr(addr,sizeof(addr))));
}
}