diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-03 18:41:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-03 18:41:26 -0700 |
commit | 95d01279a5def709d0a5d5ae7224d6286006d120 (patch) | |
tree | 5d257a2255ea2872189f1c3ec70dfd58356a9f9d /source/smbd | |
parent | e848506c858bd16706c1d7f6b4b032005512b8ac (diff) | |
download | samba-95d01279a5def709d0a5d5ae7224d6286006d120.tar.gz samba-95d01279a5def709d0a5d5ae7224d6286006d120.tar.xz samba-95d01279a5def709d0a5d5ae7224d6286006d120.zip |
I can't get away without a 'length' arg. :-).
Jeremy.
Diffstat (limited to 'source/smbd')
-rw-r--r-- | source/smbd/connection.c | 2 | ||||
-rw-r--r-- | source/smbd/process.c | 3 | ||||
-rw-r--r-- | source/smbd/server.c | 6 | ||||
-rw-r--r-- | source/smbd/service.c | 6 | ||||
-rw-r--r-- | source/smbd/session.c | 4 | ||||
-rw-r--r-- | source/smbd/sesssetup.c | 3 |
6 files changed, 15 insertions, 9 deletions
diff --git a/source/smbd/connection.c b/source/smbd/connection.c index 4b896686400..f0415138204 100644 --- a/source/smbd/connection.c +++ b/source/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/source/smbd/process.c b/source/smbd/process.c index f35e7054d77..24feac46309 100644 --- a/source/smbd/process.c +++ b/source/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/source/smbd/server.c b/source/smbd/server.c index 34b3d4a32a8..e77573b9c6b 100644 --- a/source/smbd/server.c +++ b/source/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/source/smbd/service.c b/source/smbd/service.c index 2901cd3417c..502fadedc75 100644 --- a/source/smbd/service.c +++ b/source/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/source/smbd/session.c b/source/smbd/session.c index 15154162b95..69f4a37c850 100644 --- a/source/smbd/session.c +++ b/source/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/source/smbd/sesssetup.c b/source/smbd/sesssetup.c index 35efbc009f9..87cb3b435b3 100644 --- a/source/smbd/sesssetup.c +++ b/source/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)))); } } |