svn commit: samba r8579 - in branches/SAMBA_4_0/source/lib: .

tridge at samba.org tridge at samba.org
Tue Jul 19 05:09:36 GMT 2005


Author: tridge
Date: 2005-07-19 05:09:36 +0000 (Tue, 19 Jul 2005)
New Revision: 8579

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8579

Log:
recognise the name 'localhost' as 127.0.0.1. This solves a problem
with some hosts that are missing localhost from /etc/hosts

Modified:
   branches/SAMBA_4_0/source/lib/util.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util.c	2005-07-19 04:40:11 UTC (rev 8578)
+++ branches/SAMBA_4_0/source/lib/util.c	2005-07-19 05:09:36 UTC (rev 8579)
@@ -339,6 +339,11 @@
 	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)) {



More information about the samba-cvs mailing list