proxmox/proxmox-sys
Dominik Csapak 787c2e03d7 sys: open directories with O_CLOEXEC
Factor out the open-flags to use for directories and add the CLOEXEC
flag to ensure that open FDs do not get passed to any child process.

A prominent cases where this can happen is the proxmox-daemon reload
code, which re-execs itself in a forked child-process and thus gets
all FDs passed.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
 [ TL: expand doc-comment and reword commit message to point at actual
   thing this fixes (exec not daemon reload) ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-02 17:06:25 +01:00
..
debian tree-wide: check in d/control meta changes for newer debcargo 2024-11-26 14:44:33 +01:00
src sys: open directories with O_CLOEXEC 2024-12-02 17:06:25 +01:00
tests run cargo fmt 2024-06-24 10:02:31 +02:00
Cargo.toml tree-wide: unify workspace inherited attributes 2024-09-20 08:42:45 +02:00