tailscale/net/dns
David Anderson a320d70614 net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails.
In some containers, /etc/resolv.conf is a bind-mount from outside the container.
This prevents renaming to or from /etc/resolv.conf, because it's on a different
filesystem from linux's perspective. It also prevents removing /etc/resolv.conf,
because doing so would break the bind-mount.

If we find ourselves within this environment, fall back to using copy+delete when
renaming to /etc/resolv.conf, and copy+truncate when renaming from /etc/resolv.conf.

Fixes #3000

Co-authored-by: Denton Gentry <dgentry@tailscale.com>
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-10-26 09:03:37 -07:00
..
resolver net/dns/resolver: set maxDoHInFlight to 1000 on iOS 15+. 2021-10-14 23:29:23 -04:00
config.go net/dns: replace resolver IPs with type for DoH 2021-09-07 14:44:26 -07:00
debian_resolvconf.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
direct_test.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
direct.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
flush_default.go wgengine: flush DNS cache after major link change. 2021-09-19 22:58:53 -07:00
flush_windows.go wgengine: flush DNS cache after major link change. 2021-09-19 22:58:53 -07:00
ini_test.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
ini.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
manager_default.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
manager_freebsd.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
manager_linux_test.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
manager_linux.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
manager_openbsd.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
manager_test.go net/dns: replace resolver IPs with type for DoH 2021-09-07 14:44:26 -07:00
manager_windows.go net/dns: correct log message. 2021-08-03 13:58:29 -07:00
manager.go wgengine: flush DNS cache after major link change. 2021-09-19 22:58:53 -07:00
nm.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
noop.go net/dns: return error from NewOSManager, use it to initialize NM. 2021-04-12 15:51:37 -07:00
openresolv.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
osconfig.go net/dns: make debian_resolvconf correctly clear DNS configs. 2021-04-20 15:51:14 -07:00
registry_windows.go wgengine/router/dns: move to net/dns. 2021-03-25 16:25:30 -07:00
resolvconf-workaround.sh net/dns: also include 'tail' and 'base' files when fixing up resolv.conf. 2021-04-10 23:01:11 -07:00
resolvconf.go net/dns: exhaustively test DNS selection paths for linux. 2021-09-04 23:40:48 -07:00
resolved.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
wsl_windows.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00