[pve-devel] applied: [PATCH v2] Tools: add setresuid syscall

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Apr 17 12:15:15 CEST 2019


On 4/17/19 10:51 AM, Stoiko Ivanov wrote:
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> Changes v1 -> v2:
> * incorporated Thomas' feedback
> * learned (again) that `git log -p -- $filename` does not show the complete
>   picture

applied, thanks, added info why we do not need to care about setresuid vs
setresuid32 as on modern x64 systems we only have the former as unified
one as they started newly the did not need to add a separate call for ABI
compat.

> 
>  src/PVE/Syscall.pm | 1 +
>  src/PVE/Tools.pm   | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/src/PVE/Syscall.pm b/src/PVE/Syscall.pm
> index 0f50c63..a2903b7 100644
> --- a/src/PVE/Syscall.pm
> +++ b/src/PVE/Syscall.pm
> @@ -13,6 +13,7 @@ BEGIN {
>  	close => &SYS_close,
>  	mkdirat => &SYS_mkdirat,
>  	faccessat => &SYS_faccessat,
> +	setresuid => &SYS_setresuid,
>      );
>  };
>  
> diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
> index 189b552..4dd073f 100644
> --- a/src/PVE/Tools.pm
> +++ b/src/PVE/Tools.pm
> @@ -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);
> 





More information about the pve-devel mailing list