mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 12:38:04 +02:00
ifupdown: return NULL hostname, not a zero-length string
This commit is contained in:
parent
9e2ec0b7a1
commit
6f2aa8a817
1 changed files with 6 additions and 0 deletions
|
|
@ -565,6 +565,12 @@ update_system_hostname(NMInotifyHelper *inotify_helper,
|
|||
|
||||
priv->hostname = g_strstrip(hostname_file);
|
||||
|
||||
/* We shouldn't return a zero-length hostname, but NULL */
|
||||
if (priv->hostname && !strlen (priv->hostname)) {
|
||||
g_free (priv->hostname);
|
||||
priv->hostname = NULL;
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (config), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue