NetworkManager/man
Thomas Haller 644aa42f68 dns: change main.rc-manager=file behavior to always follow symlink
With "main.rc-manager=file", if /etc/resolv.conf is a symlink, NetworkManager
would follow the symlink and update the file instead.

However, note that realpath() only returns a target, if the file actually
exists. That means, if /etc/resolv.conf is a dangling symlink, NetworkManager
would replace the symlink with a file.

This was the only case in which NetworkManager would every change a symlink
resolv.conf to a file. I think this is undesired behavior.

This is a change in long established behavior. Although note that there were several
changes regarding rc-manager settings in the past. See for example commit [1] and [2].

Now, first still try using realpath() as before. Only if that fails, try
to resolve /etc/resolv.conf as a symlink with readlink().

Following the dangling symlink is likely not a problem for the user, it
probably is even desired. The part that most likely can cause problems
is if the destination file is not writable. That happens for example, if
the destination's parent directories are missing. In this case, NetworkManager
will now fail to write resolv.conf and log a warning. This has the potential of
breaking existing setups, but it really is a mis-configuration from the user's
side.

This fixes for example the problem, if the user configures
/etc/resolv.conf as symlink to /tmp/my-resolv.conf. At boot, the file
would not exist, and NetworkManager would previously always replace the
link with a plain file. Instead, it should follow the symlink and create
the file.

[1] 718fd22436
[2] 15177a34be

https://github.com/NetworkManager/NetworkManager/pull/127
2018-06-05 16:21:10 +02:00
..
common.ent.in build: use sed instead of AC_SUBST() to generate man/common.ent 2017-02-15 18:36:24 +01:00
meson.build build: add initial support for meson build system 2017-12-13 15:48:50 +01:00
NetworkManager.conf.xml dns: change main.rc-manager=file behavior to always follow symlink 2018-06-05 16:21:10 +02:00
NetworkManager.xml man: document all setting plugins in NetworkManager.conf manual 2017-12-21 10:50:33 +01:00
nm-online.xml man: turn the manual page cross-references into links 2016-06-21 18:40:13 +02:00
nm-openvswitch.xml man/openvswitch: fix type in examples 2017-12-19 10:02:12 +01:00
nm-settings-ifcfg-rh.xsl man: fix evaluation of unsupported ifcfg-rh settings 2017-09-05 10:33:42 +02:00
nm-settings-keyfile.xsl man: turn the manual page cross-references into links 2016-06-21 18:40:13 +02:00
nm-settings.xsl man: clearify plain text secrets in keyfile 2017-09-28 17:56:49 +02:00
nmcli-examples.xml nmcli: add -g[et-values] option as a '-m tab -t -f <arg>' shortcut 2017-03-28 10:55:00 +02:00
nmcli.xml cli: allow setting the colors with terminal-colors.d(5) 2018-05-10 14:36:58 +02:00
nmtui.1.in man: update version number and dates in manual pages 2016-03-09 10:11:27 +01:00
nmtui.xml man: turn the manual page cross-references into links 2016-06-21 18:40:13 +02:00