diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-11-07 09:04:57 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-11-07 09:04:57 +0000 |
commit | 99cbab5c3b2fa9af822415a24832892e869f1d3e (patch) | |
tree | 93482a06824902f98dd288759fcea7d04be1b76e /source3/lib | |
parent | 6a594ea65e9a6a07a64b68f2d987795eba27e324 (diff) | |
download | samba-99cbab5c3b2fa9af822415a24832892e869f1d3e.tar.gz samba-99cbab5c3b2fa9af822415a24832892e869f1d3e.tar.bz2 samba-99cbab5c3b2fa9af822415a24832892e869f1d3e.zip |
From 3_0:
Simple rename of get_socket_addr to get_peer_addr and get_socket_name to
get_peer_name. This is to get closer to the getsockname/getpeername system
functions.
Next step will be the %i macro for the local IP address. I still want to play
%L-games in times of port 445.
Volker
(This used to be commit 99311b437be050fd9ee656cd184f299993d20bfb)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/access.c | 14 | ||||
-rw-r--r-- | source3/lib/util_sock.c | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/source3/lib/access.c b/source3/lib/access.c index 62414726fb..a642a92d71 100644 --- a/source3/lib/access.c +++ b/source3/lib/access.c @@ -311,21 +311,21 @@ BOOL check_access(int sock, const char **allow_list, const char **deny_list) if (only_ipaddrs_in_list(allow_list) && only_ipaddrs_in_list(deny_list)) { only_ip = True; DEBUG (3, ("check_access: no hostnames in host allow/deny list.\n")); - ret = allow_access(deny_list,allow_list, "", get_socket_addr(sock)); + ret = allow_access(deny_list,allow_list, "", get_peer_addr(sock)); } else { DEBUG (3, ("check_access: hostnames in host allow/deny list.\n")); - ret = allow_access(deny_list,allow_list, get_socket_name(sock,True), - get_socket_addr(sock)); + ret = allow_access(deny_list,allow_list, get_peer_name(sock,True), + get_peer_addr(sock)); } if (ret) { DEBUG(2,("Allowed connection from %s (%s)\n", - only_ip ? "" : get_socket_name(sock,True), - get_socket_addr(sock))); + only_ip ? "" : get_peer_name(sock,True), + get_peer_addr(sock))); } else { DEBUG(0,("Denied connection from %s (%s)\n", - only_ip ? "" : get_socket_name(sock,True), - get_socket_addr(sock))); + only_ip ? "" : get_peer_name(sock,True), + get_peer_addr(sock))); } } diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index b59d7aa7eb..bdd167b04d 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -794,12 +794,12 @@ void client_setfd(int fd) char *client_name(void) { - return get_socket_name(client_fd,False); + return get_peer_name(client_fd,False); } char *client_addr(void) { - return get_socket_addr(client_fd); + return get_peer_addr(client_fd); } struct in_addr *client_inaddr(struct sockaddr *sa) @@ -866,7 +866,7 @@ static BOOL matchname(char *remotehost,struct in_addr addr) Return the DNS name of the remote end of a socket. ******************************************************************/ -char *get_socket_name(int fd, BOOL force_lookup) +char *get_peer_name(int fd, BOOL force_lookup) { static pstring name_buf; static fstring addr_buf; @@ -879,10 +879,10 @@ char *get_socket_name(int fd, BOOL force_lookup) with dns. To avoid the delay we avoid the lookup if possible */ if (!lp_hostname_lookups() && (force_lookup == False)) { - return get_socket_addr(fd); + return get_peer_addr(fd); } - p = get_socket_addr(fd); + p = get_peer_addr(fd); /* it might be the same as the last one - save some DNS work */ if (strcmp(p, addr_buf) == 0) return name_buf; @@ -918,7 +918,7 @@ char *get_socket_name(int fd, BOOL force_lookup) Return the IP addr of the remote end of a socket as a string. ******************************************************************/ -char *get_socket_addr(int fd) +char *get_peer_addr(int fd) { struct sockaddr sa; struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa); |