1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

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 2b83ad0396)
This commit is contained in:
Andrew Tridgell 2001-09-13 00:30:47 +00:00
parent 544d0cf829
commit 5366c4c542
2 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -265,6 +265,7 @@ typedef struct
BOOL bHideLocalUsers;
BOOL bUnicode;
BOOL bUseMmap;
BOOL bHostnameLookups;
}
global;
@ -812,6 +813,7 @@ static struct parm_struct parm_table[] = {
{"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE},
{"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE},
{"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0},
{"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0},
{"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE},
{"Printing Options", P_SEP, P_SEPARATOR},
@ -1289,6 +1291,10 @@ static void init_globals(void)
Globals.bUseMmap = True;
#endif
/* hostname lookups can be very expensive and are broken on
a large number of sites (tridge) */
Globals.bHostnameLookups = False;
#ifdef WITH_LDAP
/* default values for ldap */
string_set(&Globals.szLdapServer, "localhost");
@ -1565,6 +1571,7 @@ FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs)
FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks)
FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing)
FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap)
FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups)
FN_GLOBAL_INTEGER(lp_os_level, &Globals.os_level)
FN_GLOBAL_INTEGER(lp_max_ttl, &Globals.max_ttl)
FN_GLOBAL_INTEGER(lp_max_wins_ttl, &Globals.max_wins_ttl)