summaryrefslogtreecommitdiffstats
path: root/source3/lib/access.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-03 18:15:45 -0700
committerJeremy Allison <jra@samba.org>2007-11-03 18:15:45 -0700
commit6658165d5e9cd186fea74e1581091233e8990e9b (patch)
tree13d5e5fd6d9d93adb4e60e58c5abacbbb959ecc7 /source3/lib/access.c
parent73d407968002587eadd0ff13eb413ddf07c78771 (diff)
downloadsamba-6658165d5e9cd186fea74e1581091233e8990e9b.tar.gz
samba-6658165d5e9cd186fea74e1581091233e8990e9b.tar.xz
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/lib/access.c')
-rw-r--r--source3/lib/access.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/access.c b/source3/lib/access.c
index 7b78017a64..31bc515b47 100644
--- a/source3/lib/access.c
+++ b/source3/lib/access.c
@@ -346,6 +346,8 @@ bool check_access(int sock, const char **allow_list, const char **deny_list)
ret = true;
if (!ret) {
+ char addr[INET6_ADDRSTRLEN];
+
/* Bypass name resolution calls if the lists
* only contain IP addrs */
if (only_ipaddrs_in_list(allow_list) &&
@@ -356,24 +358,24 @@ bool check_access(int sock, const char **allow_list, const char **deny_list)
ret = allow_access(deny_list,
allow_list,
"",
- get_peer_addr(sock));
+ get_peer_addr(sock,addr));
} else {
DEBUG (3, ("check_access: hostnames in "
"host allow/deny list.\n"));
ret = allow_access(deny_list,
allow_list,
get_peer_name(sock,true),
- get_peer_addr(sock));
+ get_peer_addr(sock,addr));
}
if (ret) {
DEBUG(2,("Allowed connection from %s (%s)\n",
only_ip ? "" : get_peer_name(sock,true),
- get_peer_addr(sock)));
+ get_peer_addr(sock,addr)));
} else {
DEBUG(0,("Denied connection from %s (%s)\n",
only_ip ? "" : get_peer_name(sock,true),
- get_peer_addr(sock)));
+ get_peer_addr(sock,addr)));
}
}