aboutsummaryrefslogtreecommitdiff
path: root/libbb/change_identity.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/change_identity.c')
-rw-r--r--libbb/change_identity.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/libbb/change_identity.c b/libbb/change_identity.c
index b2274e0ae..f19aa8aaa 100644
--- a/libbb/change_identity.c
+++ b/libbb/change_identity.c
@@ -30,22 +30,12 @@
#include "libbb.h"
-
/* Become the user and group(s) specified by PW. */
-const char *change_identity_e2str(const struct passwd *pw)
+void change_identity(const struct passwd *pw)
{
if (initgroups(pw->pw_name, pw->pw_gid) == -1)
- return "cannot set groups";
+ bb_perror_msg_and_die("can't set groups");
endgrent(); /* ?? */
xsetgid(pw->pw_gid);
xsetuid(pw->pw_uid);
- return NULL;
-}
-
-void change_identity(const struct passwd *pw)
-{
- const char *err_msg = change_identity_e2str(pw);
-
- if (err_msg)
- bb_simple_perror_msg_and_die(err_msg);
}