aboutsummaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-08-03 15:50:10 -0500
committerRob Landley <rob@landley.net>2014-08-03 15:50:10 -0500
commit60c35c486a2ea1c6ea8920c599abf992b27542c5 (patch)
tree611210d5ddfea925cbff5607e4b2e1ec868e5195 /lib/xwrap.c
parent64038da9fe9eab1fcf7e1fb6c654a6820c6d2064 (diff)
downloadtoybox-60c35c486a2ea1c6ea8920c599abf992b27542c5.tar.gz
Implement exec -user, -group, and -newer. Enable find in defconfig.
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r--lib/xwrap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 4d8ad711..c9d1876f 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -455,6 +455,14 @@ struct passwd *xgetpwnam(char *name)
return up;
}
+struct group *xgetgrnam(char *name)
+{
+ struct group *gr = getgrnam(name);
+
+ if (!gr) perror_exit("group '%s'", name);
+ return gr;
+}
+
// setuid() can fail (for example, too many processes belonging to that user),
// which opens a security hole if the process continues as the original user.