summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sys.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 0f3181f70..8a4453104 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -570,12 +570,7 @@ asmlinkage long sys_setuid(uid_t uid)
if (uid != old_ruid && set_user(uid) < 0)
return -EAGAIN;
current->suid = uid;
- } else if (uid == current->uid) {
- /* Nothing - just set fsuid/euid */
- } else if (uid == current->suid) {
- if (set_user(uid) < 0)
- return -EAGAIN;
- } else
+ } else if ((uid != current->uid) && (uid != current->suid))
return -EPERM;
current->fsuid = current->euid = uid;