From: Sergiu Moga Date: Fri, 29 Jan 2021 18:03:32 +0000 (+0200) Subject: lib/posix-user: Register `setresgid` to syscall_shim X-Git-Tag: RELEASE-0.6~199 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6f3f684f2e1ca147257c81938db980c8543f3658;p=unikraft%2Funikraft.git lib/posix-user: Register `setresgid` to syscall_shim Register `setresgid` system call to syscall_shim library. Signed-off-by: Sergiu Moga Reviewed-by: Paul-Sebastian Ungureanu Tested-by: Unikraft CI GitHub-Pull-Request: #120 --- diff --git a/lib/posix-user/Makefile.uk b/lib/posix-user/Makefile.uk index a8f4f4f37..d01a37327 100644 --- a/lib/posix-user/Makefile.uk +++ b/lib/posix-user/Makefile.uk @@ -22,3 +22,4 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBPOSIX_USER) += setgroups-2 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBPOSIX_USER) += capget-2 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBPOSIX_USER) += setresuid-3 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBPOSIX_USER) += getresuid-3 +UK_PROVIDED_SYSCALLS-$(CONFIG_LIBPOSIX_USER) += setresgid-3 diff --git a/lib/posix-user/exportsyms.uk b/lib/posix-user/exportsyms.uk index cab1d6402..2d958cd6b 100644 --- a/lib/posix-user/exportsyms.uk +++ b/lib/posix-user/exportsyms.uk @@ -68,7 +68,6 @@ getpwnam_r getpwuid_r getpwent setegid -setresgid setregid getgroups getgrnam_r @@ -96,3 +95,6 @@ uk_syscall_r_setresuid getresuid uk_syscall_e_getresuid uk_syscall_r_getresuid +setresgid +uk_syscall_e_setresgid +uk_syscall_r_setresgid diff --git a/lib/posix-user/user.c b/lib/posix-user/user.c index 7f408033c..868fbbe35 100644 --- a/lib/posix-user/user.c +++ b/lib/posix-user/user.c @@ -245,13 +245,12 @@ UK_SYSCALL_R_DEFINE(int, getresgid, gid_t*, rgid, gid_t*, egid, gid_t*, sgid) return 0; } -int setresgid(gid_t rgid, gid_t egid, gid_t sgid) +UK_SYSCALL_R_DEFINE(int, setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) { /* We allow only UK_DEFAULT_GID */ if (rgid != UK_DEFAULT_GID || egid != UK_DEFAULT_GID || sgid != UK_DEFAULT_GID) { - errno = EINVAL; - return -1; + return -EINVAL; } return 0;