ifcfg-rh: ignore explicitly set 'localhost' hostnames (rh #441453)
To match 'network' service behavior, which would perform reverse address lookups when the HOSTNAME from /etc/sysconfig/network was 'localhost' or 'localhost.localdomain'. Just name your machine already.
This commit is contained in:
@@ -499,6 +499,15 @@ plugin_get_hostname (SCPluginIfcfg *plugin)
|
|||||||
|
|
||||||
hostname = svGetValue (network, "HOSTNAME");
|
hostname = svGetValue (network, "HOSTNAME");
|
||||||
svCloseFile (network);
|
svCloseFile (network);
|
||||||
|
|
||||||
|
/* Ignore a hostname of 'localhost' or 'localhost.localdomain' to preserve
|
||||||
|
* 'network' service behavior.
|
||||||
|
*/
|
||||||
|
if (hostname && (!strcmp (hostname, "localhost") || !strcmp (hostname, "localhost.localdomain"))) {
|
||||||
|
g_free (hostname);
|
||||||
|
hostname = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return hostname;
|
return hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user