Commit cddb9132 authored by Thomas Haller's avatar Thomas Haller
Browse files

dns: always write "/var/run/NetworkManager/resolv.conf"

Previously, if "main.rc-manager" was set to "unmanaged"
and "/etc/resolv.conf" was symlink to our internal file
"/var/run/NetworkManager/resolv.conf", NM would not rewrite
the file, in an attempt to honor the requirement of NetworkManager
not changing resolv.conf.

No longer special case this. I think it was wrong and inconsistent.
If the user specifies rc-manager unmanaged, he also should manage
/etc/resolv.conf accordingly. And if the user decided to symlink
it to our internal file, that is fine. It should not stop NM from
updating that file.

Also, this was the only cases, where NM would not write our internal
resolv.conf (errors aside). It was inconsitent, and also not documented
behavior. Instead, it is documented that `man NetworkManager.conf`:

  Regardless of this setting, NetworkManager will always write
  resolv.conf to its runtime state directory
  /var/run/NetworkManager/resolv.conf.
parent 320461c0
......@@ -791,22 +791,6 @@ update_resolv_conf (NMDnsManager *self,
gboolean resconf_link_cached = FALSE;
gs_free char *resconf_link = NULL;
/* If we are not managing /etc/resolv.conf and it points to
* MY_RESOLV_CONF, don't write the private DNS configuration to
* MY_RESOLV_CONF otherwise we would overwrite the changes done by
* some external application.
*
* This is the only situation, where we don't try to update our
* internal resolv.conf file. */
if (rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED) {
if (nm_streq0 (_read_link_cached (_PATH_RESCONF, &resconf_link_cached, &resconf_link),
MY_RESOLV_CONF)) {
_LOGD ("update-resolv-conf: not updating " _PATH_RESCONF
" since it points to " MY_RESOLV_CONF);
return SR_SUCCESS;
}
}
content = create_resolv_conf (searches, nameservers, options);
if ( rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_FILE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment