summaryrefslogtreecommitdiffstats
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-06-23 18:12:33 +0200
committerMike Yuan <me@yhndnzj.com>2024-06-24 16:01:07 +0200
commit276bd392ecdd6febaeac82e7d6f46a035826f98d (patch)
tree287470f002aaa64d3f38b29ee2906b8eb773ac6a /src/core/load-fragment.c
parentcore/load-fragment: use ASSERT_PTR where appropriate (diff)
downloadsystemd-276bd392ecdd6febaeac82e7d6f46a035826f98d.tar.xz
systemd-276bd392ecdd6febaeac82e7d6f46a035826f98d.zip
core: verify WorkingDirectory= is outside of API VFS only under mount namespacing
The purpose of the check is to prevent leaking API VFS fds from host into a mount namespace/container. When mountns is not used at all, the check is pointless and causes inconvenience. E.g. file managers might need to be spawned under those directories, and they surely won't run in mountns. Suggested in https://github.com/systemd/systemd/pull/33454#issuecomment-2186351467 Fixes #33361
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index a0b20a8d91..e2a528a629 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2635,7 +2635,8 @@ int config_parse_working_directory(
return missing_ok ? 0 : -ENOEXEC;
}
- r = path_simplify_and_warn(k, PATH_CHECK_ABSOLUTE|PATH_CHECK_NON_API_VFS|(missing_ok ? 0 : PATH_CHECK_FATAL), unit, filename, line, lvalue);
+ r = path_simplify_and_warn(k, PATH_CHECK_ABSOLUTE|(missing_ok ? 0 : PATH_CHECK_FATAL),
+ unit, filename, line, lvalue);
if (r < 0)
return missing_ok ? 0 : -ENOEXEC;