Commit 9eaf31f4 authored by Jiří Klimeš's avatar Jiří Klimeš

policy: don't cache "(none)" hostname on startup (rh #706094)

parent 19019a8e
......@@ -1172,7 +1172,10 @@ nm_policy_new (NMManager *manager,
memset (hostname, 0, sizeof (hostname));
if (gethostname (&hostname[0], HOST_NAME_MAX) == 0) {
/* only cache it if it's a valid hostname */
if (strlen (hostname) && strcmp (hostname, "localhost") && strcmp (hostname, "localhost.localdomain"))
if ( strlen (hostname)
&& strcmp (hostname, "localhost")
&& strcmp (hostname, "localhost.localdomain")
&& strcmp (hostname, "(none)"))
policy->orig_hostname = g_strdup (hostname);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment