mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 05:20:17 +01:00
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.
(cherry picked from commit 7f7e1eb60b)
This commit is contained in:
parent
51188fb046
commit
ddefd6931e
1 changed files with 1 additions and 1 deletions
|
|
@ -1663,7 +1663,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue