]> git.ipfire.org Git - thirdparty/systemd.git/commit
chase: trigger automount only when explicitly requested 38641/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Aug 2025 16:22:30 +0000 (17:22 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Aug 2025 17:32:02 +0000 (02:32 +0900)
commit4279336618a96825787e954f59984897eed27f48
treeedf3257c77c37fae0e81a8c1659db5202a06af9f
parent9dcd034085559de970092bce47de94d02c839ba5
chase: trigger automount only when explicitly requested

Since c5de7b14ae2e08d267d8d75bc88934ac6aa7dcd6
file searching implies a new mount api syscall by default,
to trigger automounts.

But, this is not necessary in most cases, e.g. when chasing
syspath in sd-device (actually this causes regression in umockdev,
see https://github.com/martinpitt/umockdev/issues/271).
Another example is reading unit files, especially .network files,
as automount may trigger mounting network filesystems...

Also, when this is used in NSS plugins, programs that load the
plugins may fail because of spuriously configured seccomp. See #38565.

Let's not trigger automount by default, and do only when explicitly
requested.

This introduces CHASE_TRIGGER_AUTOFS, and use it in
- service manager,
- bootctl and finding ESP/xbootldr,
- sysupdate,
- mountfsd,
- systemd-mount.

There may be several more places we should trigger automount, but let's
do that later.

Follow-up for c5de7b14ae2e08d267d8d75bc88934ac6aa7dcd6.
Fixes #38565.
Replaces #38569.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
16 files changed:
mkosi/mkosi.sanitizers/mkosi.postinst
src/basic/chase.c
src/basic/chase.h
src/bootctl/bootctl-install.c
src/bootctl/bootctl-status.c
src/core/exec-invoke.c
src/core/mount.c
src/core/namespace.c
src/core/service.c
src/mount/mount-tool.c
src/mountfsd/mountwork.c
src/shared/find-esp.c
src/sysupdate/sysupdate-resource.c
src/sysupdate/sysupdate-transfer.c
src/test/test-chase-manual.c
test/units/TEST-74-AUX-UTILS.userdbctl.sh