commit bash-20140606 snapshot

This commit is contained in:
Chet Ramey
2014-06-23 14:58:17 -04:00
parent dcebf63480
commit bbea163ce4
14 changed files with 2895 additions and 29 deletions
+14 -2
View File
@@ -1228,8 +1228,20 @@ uidget ()
void
disable_priv_mode ()
{
setuid (current_user.uid);
setgid (current_user.gid);
int e;
if (setuid (current_user.uid) < 0)
{
e = errno;
sys_error (_("cannot set uid to %d: effective uid %d"), current_user.uid, current_user.euid);
#if defined (EXIT_ON_SETUID_FAILURE)
if (e == EAGAIN)
exit (e);
#endif
}
if (setgid (current_user.gid) < 0)
sys_error (_("cannot set gid to %d: effective gid %d"), current_user.gid, current_user.egid);
current_user.euid = current_user.uid;
current_user.egid = current_user.gid;
}