summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386/setreuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/setreuid.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/setreuid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c
index 58ddff2b00..b660604152 100644
--- a/sysdeps/unix/sysv/linux/i386/setreuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setreuid.c
@@ -59,8 +59,8 @@ __setreuid (uid_t ruid, uid_t euid)
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setreuid32 */
- if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid)
- || (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid))
+ if (((ruid + 1) > (uid_t) ((__kernel_uid_t) -1U))
+ || ((euid + 1) > (uid_t) ((__kernel_uid_t) -1U)))
{
__set_errno (EINVAL);
return -1;