diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-04-24 11:54:50 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-04-24 18:14:12 +0200 |
commit | d404c8d887dfdd06c91409d06b695f2c502e4a41 (patch) | |
tree | eafb2828b795eb1eb980280e81283c39d378504a /src/nspawn/nspawn.c | |
parent | man: fix LogControl1 manpage example (diff) | |
download | systemd-d404c8d887dfdd06c91409d06b695f2c502e4a41.tar.xz systemd-d404c8d887dfdd06c91409d06b695f2c502e4a41.zip |
nspawn: Don't follow /etc/resolv.conf symlinks
When we're checking if /etc/resolv.conf exists so we can bind mount
on top of it, we care about whether the symlink itself exists if
/etc/resolv.conf exists and not the file it points to, so add
CHASE_NOFOLLOW to make sure we check existence of the symlink and
not the file it points to.
Diffstat (limited to '')
-rw-r--r-- | src/nspawn/nspawn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 6477cc43fa..9e5b7772ac 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2159,7 +2159,7 @@ static int setup_resolv_conf(const char *dest) { _cleanup_free_ char *resolved = NULL; int found; - found = chase(where, dest, CHASE_NONEXISTENT, &resolved, NULL); + found = chase(where, dest, CHASE_NONEXISTENT|CHASE_NOFOLLOW, &resolved, NULL); if (found < 0) { log_warning_errno(found, "Failed to resolve /etc/resolv.conf path in container, ignoring: %m"); return 0; |