summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-15 16:11:48 -0700
committerJeremy Allison <jra@samba.org>2007-10-15 16:11:48 -0700
commit666f50b01f282e520c59b94944d4b1583168d46a (patch)
tree9acb499f1bdfdb1a285a3392708b0c942fc2c17e /source3/lib/system.c
parent48cd61d30ed46e2c61c0df9d510f50ae7a11accd (diff)
downloadsamba-666f50b01f282e520c59b94944d4b1583168d46a.tar.gz
samba-666f50b01f282e520c59b94944d4b1583168d46a.tar.bz2
samba-666f50b01f282e520c59b94944d4b1583168d46a.zip
Move to protocol independent code in most of lib/util_sock.c
We don't use gethostbyname any more except in one case where we're looking for host aliases (I don't know how to do that with getaddrinfo yet). New function should be getaddrinfo(). Next step will be fixing lib/access.c, and then changing libsmb/namequery.c to cope with IPv6 address returns. Jeremy. (This used to be commit 4a56b697b6adcf095e25895c4a9ba3192ed34124)
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index bc7de84767..bf35722ea5 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -682,49 +682,6 @@ int sys_chroot(const char *dname)
#endif
}
-/**************************************************************************
-A wrapper for gethostbyname() that tries avoids looking up hostnames
-in the root domain, which can cause dial-on-demand links to come up for no
-apparent reason.
-****************************************************************************/
-
-struct hostent *sys_gethostbyname(const char *name)
-{
-#ifdef REDUCE_ROOT_DNS_LOOKUPS
- char query[HOST_NAME_MAX], hostname[HOST_NAME_MAX];
- char *domain;
-
- /* Does this name have any dots in it? If so, make no change */
-
- if (strchr_m(name, '.'))
- return(gethostbyname(name));
-
- /* Get my hostname, which should have domain name
- attached. If not, just do the gethostname on the
- original string.
- */
-
- gethostname(hostname, sizeof(hostname) - 1);
- hostname[sizeof(hostname) - 1] = 0;
- if ((domain = strchr_m(hostname, '.')) == NULL)
- return(gethostbyname(name));
-
- /* Attach domain name to query and do modified query.
- If names too large, just do gethostname on the
- original string.
- */
-
- if((strlen(name) + strlen(domain)) >= sizeof(query))
- return(gethostbyname(name));
-
- slprintf(query, sizeof(query)-1, "%s%s", name, domain);
- return(gethostbyname(query));
-#else /* REDUCE_ROOT_DNS_LOOKUPS */
- return(gethostbyname(name));
-#endif /* REDUCE_ROOT_DNS_LOOKUPS */
-}
-
-
#if defined(HAVE_POSIX_CAPABILITIES)
#ifdef HAVE_SYS_CAPABILITY_H