summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-04 17:20:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:10 -0500
commit941544a9514aaae89268bc9d689705ad0724119e (patch)
tree1f75125cb1226f2d3fd0031e5dc1e056c6e896e7 /source3/lib/system.c
parent5a3dcd8dd602dd59f3bfb1c397f80a6be3755df3 (diff)
downloadsamba-941544a9514aaae89268bc9d689705ad0724119e.tar.gz
samba-941544a9514aaae89268bc9d689705ad0724119e.tar.bz2
samba-941544a9514aaae89268bc9d689705ad0724119e.zip
r25505: Add a replacement (IPv4 only) implementation of getaddrinfo/freeaddrinfo
under the 2 clause *BSD license for future use in IPv6 code. Original code was from PostgreSQL and I've maintained their license even though I've rewritten large parts of it (I probably should donate this back to them). Jeremy. (This used to be commit 760d993340a966269d71acfb7a6b5e4d3776ac5d)
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index ab5c06d5f6..bc7de84767 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -683,7 +683,7 @@ int sys_chroot(const char *dname)
}
/**************************************************************************
-A wrapper for gethostbyname() that tries avoids looking up hostnames
+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.
****************************************************************************/
@@ -691,7 +691,7 @@ apparent reason.
struct hostent *sys_gethostbyname(const char *name)
{
#ifdef REDUCE_ROOT_DNS_LOOKUPS
- char query[256], hostname[256];
+ char query[HOST_NAME_MAX], hostname[HOST_NAME_MAX];
char *domain;
/* Does this name have any dots in it? If so, make no change */
@@ -699,9 +699,9 @@ struct hostent *sys_gethostbyname(const char *name)
if (strchr_m(name, '.'))
return(gethostbyname(name));
- /* Get my hostname, which should have domain name
+ /* Get my hostname, which should have domain name
attached. If not, just do the gethostname on the
- original string.
+ original string.
*/
gethostname(hostname, sizeof(hostname) - 1);