From 7f7e1eb60b383a1b7b8c46105718748af2b84c66 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 27 Apr 2016 15:03:50 +0200 Subject: settings: fix write_hostname for relative-symbolic links g_file_read_link() "reads" the symbolic link. If it's a relative path, we get a relative path which is anchored on @file. We must resolve that to be absolute. --- src/settings/nm-settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 304ac2c39e..b91247a9ae 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1655,7 +1655,7 @@ write_hostname (NMSettingsPrivate *priv, const char *hostname) */ if ( lstat (file, &file_stat) == 0 && S_ISLNK (file_stat.st_mode) - && (link_path = g_file_read_link (file, NULL))) + && (link_path = nm_utils_read_link_absolute (file, NULL))) file = link_path; #if HAVE_SELINUX -- cgit v1.2.1