ifcfg-rh: don't reverse lookup on 'localhost' unless NM_IGNORE_HOSTNAME_LOCALHOST=yes (rh #490184)

This commit is contained in:
Dan Williams
2009-03-23 16:43:25 -04:00
parent 31539034b3
commit 3da47fd00f

View File

@@ -479,6 +479,7 @@ plugin_get_hostname (SCPluginIfcfg *plugin)
{
shvarFile *network;
char *hostname;
gboolean ignore_localhost;
network = svNewFile (SC_NETWORK_FILE);
if (!network) {
@@ -487,8 +488,8 @@ plugin_get_hostname (SCPluginIfcfg *plugin)
}
hostname = svGetValue (network, "HOSTNAME", FALSE);
svCloseFile (network);
ignore_localhost = svTrueValue (network, "NM_IGNORE_HOSTNAME_LOCALHOST", FALSE);
if (ignore_localhost) {
/* Ignore a hostname of 'localhost' or 'localhost.localdomain' to preserve
* 'network' service behavior.
*/
@@ -496,7 +497,9 @@ plugin_get_hostname (SCPluginIfcfg *plugin)
g_free (hostname);
hostname = NULL;
}
}
svCloseFile (network);
return hostname;
}