summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-13 00:30:47 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-13 00:30:47 +0000
commit5366c4c542b2a1c7bcc268daba02af25ce6eab6e (patch)
tree3c80b79714c09b01abe0fc45a8c2d441f16e5c9e /source3/lib
parent544d0cf82988e270dbf91e0d3ee18efcbb452567 (diff)
downloadsamba-5366c4c542b2a1c7bcc268daba02af25ce6eab6e.tar.gz
samba-5366c4c542b2a1c7bcc268daba02af25ce6eab6e.tar.bz2
samba-5366c4c542b2a1c7bcc268daba02af25ce6eab6e.zip
added a new global option "hostname lookups = yes/no"
This should finally kill off the remaining places where we attempt reverse lookups of the IP of the client. It may be that some pam modules called via the session code will need "hostname lookups = yes" but I've left it off by default as most sites don't need it and so many sites have broken reverse maps (This used to be commit 2b83ad03965d00bba88fe56452d2990099b75ef1)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 47f1d507ed..9d7e5df303 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -984,6 +984,14 @@ char *get_socket_name(int fd)
struct hostent *hp;
struct in_addr addr;
char *p;
+
+ /* reverse lookups can be *very* expensive, and in many
+ situations won't work because many networks don't link dhcp
+ with dns. To avoid the delay we avoid the lookup if
+ possible */
+ if (!lp_hostname_lookups()) {
+ return get_socket_addr(fd);
+ }
p = get_socket_addr(fd);