Commit 768c03fe authored by Linus Torvalds's avatar Linus Torvalds

Make setresuid/setresgid be more consistent wrt fsuid handling

parent cb0c3669
...@@ -679,8 +679,8 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) ...@@ -679,8 +679,8 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
wmb(); wmb();
} }
current->euid = euid; current->euid = euid;
current->fsuid = euid;
} }
current->fsuid = current->euid;
if (suid != (uid_t) -1) if (suid != (uid_t) -1)
current->suid = suid; current->suid = suid;
...@@ -725,8 +725,8 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) ...@@ -725,8 +725,8 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
wmb(); wmb();
} }
current->egid = egid; current->egid = egid;
current->fsgid = egid;
} }
current->fsgid = current->egid;
if (rgid != (gid_t) -1) if (rgid != (gid_t) -1)
current->gid = rgid; current->gid = rgid;
if (sgid != (gid_t) -1) if (sgid != (gid_t) -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment