diff options
| author | Michael Biebl <biebl@debian.org> | 2018-06-17 14:54:57 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-06-17 14:54:57 +0200 |
| commit | 9d9b149b81f5ea5fe53ac383fda9cf3afb96b30f (patch) | |
| tree | a47c80e4d962d3f2202dbab41e2744c921fb8567 /src/dns | |
| parent | 03218e6d85e6654bd942b7531ba48b9d9535d55f (diff) | |
| parent | 069cb5c3a525ebcc19cc2927964258acaca87b13 (diff) | |
Update upstream source from tag 'upstream/1.11.90'
Update to upstream version '1.11.90' with Debian dir 13153fad72263d24704dca73c994fe8f7bfd3a28
Diffstat (limited to 'src/dns')
| -rw-r--r-- | src/dns/nm-dns-manager.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c index f5500ee7..a29fd81f 100644 --- a/src/dns/nm-dns-manager.c +++ b/src/dns/nm-dns-manager.c @@ -768,8 +768,6 @@ update_resolv_conf (NMDnsManager *self, gs_free char *content = NULL; SpawnResult write_file_result = SR_SUCCESS; int errsv; - const char *rc_path = _PATH_RESCONF; - nm_auto_free char *rc_path_real = NULL; gboolean resconf_link_cached = FALSE; gs_free char *resconf_link = NULL; @@ -794,12 +792,27 @@ update_resolv_conf (NMDnsManager *self, if ( rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_FILE || ( rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_SYMLINK && !_read_link_cached (_PATH_RESCONF, &resconf_link_cached, &resconf_link))) { + gs_free char *rc_path_syml = NULL; + nm_auto_free char *rc_path_real = NULL; + const char *rc_path = _PATH_RESCONF; GError *local = NULL; if (rc_manager == NM_DNS_MANAGER_RESOLV_CONF_MAN_FILE) { - rc_path_real = realpath (rc_path, NULL); + rc_path_real = realpath (_PATH_RESCONF, NULL); if (rc_path_real) rc_path = rc_path_real; + else { + /* realpath did not resolve a path-name. That either means, + * _PATH_RESCONF: + * - does not exist + * - is a plain file + * - is a dangling symlink + * + * Handle the case, where it is a dangling symlink... */ + rc_path_syml = nm_utils_read_link_absolute (_PATH_RESCONF, NULL); + if (rc_path_syml) + rc_path = rc_path_syml; + } } /* we first write to /etc/resolv.conf directly. If that fails, |