summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-21 10:54:50 +0200
committerThomas Haller <thaller@redhat.com>2018-09-21 11:12:47 +0200
commitcddb91324c4d7c86fe9f21a1fc97f92dd47a1ee5 (patch)
tree2ed9d504bcd3f263f4d79ddfd22974c0b67385e5
parent320461c06277f0c817980aadd80d90db45748c4b (diff)
downloadNetworkManager-cddb91324c4d7c86fe9f21a1fc97f92dd47a1ee5.tar.gz
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.
-rw-r--r--src/dns/nm-dns-manager.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c
index 2755b26241..62ea02b755 100644
--- a/src/dns/nm-dns-manager.c
+++ b/src/dns/nm-dns-manager.c
@@ -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