diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-03 18:15:45 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-03 18:15:45 -0700 |
commit | 6658165d5e9cd186fea74e1581091233e8990e9b (patch) | |
tree | 13d5e5fd6d9d93adb4e60e58c5abacbbb959ecc7 /source3/smbd/process.c | |
parent | 73d407968002587eadd0ff13eb413ddf07c78771 (diff) | |
download | samba-6658165d5e9cd186fea74e1581091233e8990e9b.tar.gz samba-6658165d5e9cd186fea74e1581091233e8990e9b.tar.bz2 samba-6658165d5e9cd186fea74e1581091233e8990e9b.zip |
Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
(This used to be commit e848506c858bd16706c1d7f6b4b032005512b8ac)
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 11fdb03d72..f35e7054d7 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1460,15 +1460,18 @@ static void process_smb(char *inbuf, size_t nread, size_t unread_bytes) DO_PROFILE_INC(smb_count); if (trans_num == 0) { + char addr[INET6_ADDRSTRLEN]; + /* on the first packet, check the global hosts allow/ hosts deny parameters before doing any parsing of the packet passed to us by the client. This prevents attacks on our parsing code from hosts not in the hosts allow list */ + if (!check_access(smbd_server_fd(), lp_hostsallow(-1), 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() ) ); + DEBUG( 1, ( "Connection denied from %s\n", client_addr(addr) ) ); (void)send_smb(smbd_server_fd(),(char *)buf); exit_server_cleanly("connection denied"); } |