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)));
}
}
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)
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;
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;
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);
/* this is needed so that we get decent entries
in smbstatus for port 445 connects */
- set_remote_machine_name(get_socket_addr(smbd_server_fd()), False);
+ set_remote_machine_name(get_peer_addr(smbd_server_fd()), False);
/* Reset global variables in util.c so
that client substitutions will be
char *cgi_remote_host(void)
{
if (inetd_server) {
- return get_socket_name(1,False);
+ return get_peer_name(1,False);
}
return getenv("REMOTE_HOST");
}
char *cgi_remote_addr(void)
{
if (inetd_server) {
- return get_socket_addr(1);
+ return get_peer_addr(1);
}
return getenv("REMOTE_ADDR");
}
return;
}
- fstrcpy(peer,get_socket_addr(q->fd));
+ fstrcpy(peer,get_peer_addr(q->fd));
addr=*interpret_addr2(peer);
get_our_last_id(&global_wins_table[0][0]);
fstring peer;
struct in_addr addr;
int i;
- fstrcpy(peer,get_socket_addr(p->fd));
+ fstrcpy(peer,get_peer_addr(p->fd));
addr=*interpret_addr2(peer);
for (i=1; i<partner_count; i++)