]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-user: Register `setresgid` to syscall_shim
authorSergiu Moga <sergiu.moga@protonmail.com>
Fri, 29 Jan 2021 18:03:32 +0000 (20:03 +0200)
committerUnikraft <monkey@unikraft.io>
Sat, 15 May 2021 17:46:30 +0000 (17:46 +0000)
Register `setresgid` system call to syscall_shim library.

Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #120

lib/posix-user/Makefile.uk
lib/posix-user/exportsyms.uk
lib/posix-user/user.c

index a8f4f4f370b1c2ba8b037025a120854912cb6185..d01a373273e82ccbd6f3eb05b97ac6ef1c3d4019 100644 (file)
@@ -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
index cab1d64021cf773df8b73515edf067753c640476..2d958cd6b2df5f37a7973e544e9895ca66844961 100644 (file)
@@ -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
index 7f408033c4cc593a1a8571b3daeafbd97a5a4205..868fbbe355f48b7d734570a983c1e4246ad75428 100644 (file)
@@ -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;