The fchmodat syscall changes the mode of a file relative to a file descriptor.
Signed-off-by: Filip Schauer <[email protected]> --- src/PVE/Syscall.pm | 1 + src/PVE/Tools.pm | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/PVE/Syscall.pm b/src/PVE/Syscall.pm index 68e16fe..606cc56 100644 --- a/src/PVE/Syscall.pm +++ b/src/PVE/Syscall.pm @@ -22,6 +22,7 @@ BEGIN { setresuid => &SYS_setresuid, fallocate => &SYS_fallocate, fchownat => &SYS_fchownat, + fchmodat => &SYS_fchmodat, mount => &SYS_mount, renameat2 => &SYS_renameat2, open_tree => &SYS_open_tree, diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 3c6f2fb..a7bb3da 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -1505,6 +1505,17 @@ sub fchownat($$$$$) { ) == 0; } +sub fchmodat($$$$) { + my ($dirfd, $pathname, $mode, $flags) = @_; + return syscall( + PVE::Syscall::fchmodat, + int($dirfd), + $pathname, + int($mode), + int($flags), + ) == 0; +} + my $salt_starter = time(); sub encrypt_pw { -- 2.47.3 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
