diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-07-15 23:00:46 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-07-15 23:00:46 +0000 |
commit | 43e528fab90c1deee5f4de09be7d538022ebf5d4 (patch) | |
tree | 087cd0a58a163f3ea7819e59abecbd901227486a /libbb | |
parent | 6216fdde8d70023e7651d7ddb44df776819ec320 (diff) | |
download | busybox-w32-43e528fab90c1deee5f4de09be7d538022ebf5d4.tar.gz busybox-w32-43e528fab90c1deee5f4de09be7d538022ebf5d4.tar.bz2 busybox-w32-43e528fab90c1deee5f4de09be7d538022ebf5d4.zip |
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/
git-svn-id: svn://busybox.net/trunk/busybox@15700 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xfuncs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index bcd0751ee..d843414f9 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -282,3 +282,15 @@ char *itoa(int n) | |||
282 | return local_buf; | 282 | return local_buf; |
283 | } | 283 | } |
284 | #endif | 284 | #endif |
285 | |||
286 | #ifdef L_setuid | ||
287 | void xsetgid(gid_t gid) | ||
288 | { | ||
289 | if (setgid(gid)) bb_error_msg_and_die("setgid"); | ||
290 | } | ||
291 | |||
292 | void xsetuid(uid_t uid) | ||
293 | { | ||
294 | if (setuid(uid)) bb_error_msg_and_die("setuid"); | ||
295 | } | ||
296 | #endif | ||