We need xsetuid() and xsetgid() because per-user process resource limits can

prevent a process from switching to a user that has too many processes, and
when that happens WE'RE STILL ROOT.  See http://lwn.net/Articles/190331/
This commit is contained in:
Rob Landley
2006-07-15 23:00:46 +00:00
parent 1870737480
commit df822f2606
2 changed files with 14 additions and 0 deletions

View File

@ -282,3 +282,15 @@ char *itoa(int n)
return local_buf;
}
#endif
#ifdef L_setuid
void xsetgid(gid_t gid)
{
if (setgid(gid)) bb_error_msg_and_die("setgid");
}
void xsetuid(uid_t uid)
{
if (setuid(uid)) bb_error_msg_and_die("setuid");
}
#endif