See `man 2 setresuid`. The code was tested with small UIDs (109) and
one which does not fit into 16 bit (
100000000), since I wasn't too
sure about the workings of setresuid vs. setresuid32 (see NOTES of
the manpage) - it worked with both.
Linux on amd64 has only a single setresuid, as it the 64 bit arch
came after the setresuid32 syscall, and thus it started with the
later one as single common one
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
close => &SYS_close,
mkdirat => &SYS_mkdirat,
faccessat => &SYS_faccessat,
+ setresuid => &SYS_setresuid,
);
};
return; # nothing
}
+sub setresuid($$$) {
+ my ($ruid, $euid, $suid) = @_;
+ return 0 == syscall(PVE::Syscall::setresuid, $ruid, $euid, $suid);
+}
+
sub unshare($) {
my ($flags) = @_;
return 0 == syscall(PVE::Syscall::unshare, $flags);