diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-19 05:09:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:40 -0500 |
commit | 9a4bc49fee7666427c35db287948d5acc47990e2 (patch) | |
tree | 42cca6b6f7c91327d344eff2ab6e436d110e4b5e /source4 | |
parent | 8638d01a28b0151c49685fb574a24a99a89144e2 (diff) | |
download | samba-9a4bc49fee7666427c35db287948d5acc47990e2.tar.gz samba-9a4bc49fee7666427c35db287948d5acc47990e2.tar.bz2 samba-9a4bc49fee7666427c35db287948d5acc47990e2.zip |
r8579: recognise the name 'localhost' as 127.0.0.1. This solves a problem
with some hosts that are missing localhost from /etc/hosts
(This used to be commit f9866258e099001390aa61dcc12055fe1374db60)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/util.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/util.c b/source4/lib/util.c index 308d1b6f45..03ae86422f 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -339,6 +339,11 @@ uint32_t interpret_addr(const char *str) if (strcmp(str,"255.255.255.255") == 0) { return 0xFFFFFFFF; } + /* recognise 'localhost' as a special name. This fixes problems with + some hosts that don't have localhost in /etc/hosts */ + if (strcmp(str,"localhost") == 0) { + str = "127.0.0.1"; + } /* if it's in the form of an IP address then get the lib to interpret it */ if (is_ipaddress(str)) { |