diff options
author | Thomas Haller <thaller@redhat.com> | 2018-06-01 10:08:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-06-05 16:21:10 +0200 |
commit | 644aa42f68d9d6f30144dba243f95690226a777c (patch) | |
tree | 76b2d2cbf728252257588d3fdf3081a54fa51110 /man/NetworkManager.conf.xml | |
parent | 92ebd16cee2a7a306abae7fd3cba3f1366471f14 (diff) | |
download | NetworkManager-644aa42f68d9d6f30144dba243f95690226a777c.tar.gz |
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] 718fd2243690b8c72dd1cb32f67114f304542082
[2] 15177a34be297654086005f2d796e6a4c6a1b918
https://github.com/NetworkManager/NetworkManager/pull/127
Diffstat (limited to 'man/NetworkManager.conf.xml')
-rw-r--r-- | man/NetworkManager.conf.xml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 6f333acd6f..8a1b04bc09 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -367,8 +367,10 @@ no-auto-default=* <para><literal>file</literal>: NetworkManager will write <filename>/etc/resolv.conf</filename> as file. If it finds a symlink to an existing target, it will follow the symlink and - update the target instead. If the symlink's target does not exist, - the symlink will be replaced by a file.</para> + update the target instead. In no case will an existing symlink + be replaced by a file. Note that older versions of NetworkManager + behaved differently and would replace dangling symlinks with a + plain file.</para> <para><literal>resolvconf</literal>: NetworkManager will run resolvconf to update the DNS configuration.</para> <para><literal>netconfig</literal>: NetworkManager will run |