Files
systemd/src/validatefs
Christian Brauner b19e5e4921 sd-device: add device_open() which always sets O_CLOEXEC
sd_device_open() is public API and keeps returning non-cloexec fds
unless the caller passes O_CLOEXEC. So every internal caller has to
remember to pass it and storage-block.c didn't, so the block device fds
it opens aren't O_CLOEXEC.

Move the open logic into device_open() which always sets O_CLOEXEC, like
our other open helpers do, and turn sd_device_open() into a wrapper that
clears it again if the caller didn't ask for it. Use device_open() for
all internal callers, which also makes device_open_from_devnum() set
O_CLOEXEC on its own, and drop O_CLOEXEC from all the callers.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-11-02 09:21:12 +01:00
..