mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-13 03:50:17 +00:00
Tools: add setresuid syscall
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>
This commit is contained in:
parent
096b5f5c06
commit
0c078e6645
@ -13,6 +13,7 @@ BEGIN {
|
||||
close => &SYS_close,
|
||||
mkdirat => &SYS_mkdirat,
|
||||
faccessat => &SYS_faccessat,
|
||||
setresuid => &SYS_setresuid,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -1384,6 +1384,11 @@ sub parse_host_and_port {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user