[pbs-devel] applied: [PATCH proxmox v2 1/2] sys: fs: set CLOEXEC when creating temp files
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon Dec 2 17:07:41 CET 2024
Am 29.11.24 um 15:28 schrieb Dominik Csapak:
> In general we want all open files to have set CLOEXEC since our
> reloading mechanism can basically fork at any moment and we don't want
> newer daemons to carry around old file descriptors, especially lock
> files.
>
> Since `make_tmp_file` is called by many things (e.g. open_file_locked,
> logrotate, rrd), set O_CLOEXEC with mkostemp.
>
> This fixes issues with leftover file descriptors e.g. tape backups not
> working because of lingering locks after a reload, or having deleted
> rrd files open.
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> changes from v1:
> * introduce mkostemp helper which is similar to nix's mkstemp helper
> (the code is a copy of mkstemp aside from the call to libcmkostemp +
> the oflag handling)
>
> I did it this way, since we may be able to upstream this, have
> to look more closer at this though.
>
> proxmox-sys/src/fs/file.rs | 25 ++++++++++++++++++++++++-
> 1 file changed, 24 insertions(+), 1 deletion(-)
>
>
applied both patches with Fabian's R-b, thanks!
I amended the doc-comment and commit message of the second patch a bit
though.
More information about the pbs-devel
mailing list