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.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libbb/change_identity.c b/libbb/change_identity.c
index 63c5ae1c8..3f888f523 100644
--- a/libbb/change_identity.c
+++ b/libbb/change_identity.c
@@ -28,14 +28,6 @@
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31#include <stdio.h>
32#include <errno.h>
33#include <unistd.h>
34#include <string.h>
35#include <stdlib.h>
36#include <syslog.h>
37#include <ctype.h>
38
39#include "libbb.h" 31#include "libbb.h"
40 32
41 33
@@ -44,8 +36,7 @@ const char *change_identity_e2str(const struct passwd *pw)
44{ 36{
45 if (initgroups(pw->pw_name, pw->pw_gid) == -1) 37 if (initgroups(pw->pw_name, pw->pw_gid) == -1)
46 return "cannot set groups"; 38 return "cannot set groups";
47 endgrent(); 39 endgrent(); /* ?? */
48
49 xsetgid(pw->pw_gid); 40 xsetgid(pw->pw_gid);
50 xsetuid(pw->pw_uid); 41 xsetuid(pw->pw_uid);
51 return NULL; 42 return NULL;
@@ -55,6 +46,6 @@ void change_identity(const struct passwd *pw)
55{ 46{
56 const char *err_msg = change_identity_e2str(pw); 47 const char *err_msg = change_identity_e2str(pw);
57 48
58 if(err_msg) 49 if (err_msg)
59 bb_perror_msg_and_die("%s", err_msg); 50 bb_perror_msg_and_die("%s", err_msg);
60} 51}