diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-12 22:10:25 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-12 22:10:25 +0000 |
commit | 4e6c8120a53709c4a352db42e997303844c74584 (patch) | |
tree | 67494852dbb86ff0c25f161181bca156cd9a612e /libbb/change_identity.c | |
parent | 35e9c5d83ada1fea40798365a1b4c728f64ded98 (diff) | |
download | busybox-w32-4e6c8120a53709c4a352db42e997303844c74584.tar.gz busybox-w32-4e6c8120a53709c4a352db42e997303844c74584.tar.bz2 busybox-w32-4e6c8120a53709c4a352db42e997303844c74584.zip |
crond: make it NOMMU-capable
function old new delta
safe_setenv4 - 62 +62
ForkJob 472 511 +39
change_identity 21 57 +36
ParseField 564 571 +7
SynchronizeDir 178 176 -2
LogLevel 4 - -4
LogFile 4 - -4
FileBase 4 - -4
DebugOpt 4 - -4
CDir 4 - -4
DeleteFile 141 132 -9
packed_usage 24248 24228 -20
crondlog 157 113 -44
change_identity_e2str 54 - -54
SynchronizeFile 729 671 -58
crond_main 1555 1404 -151
------------------------------------------------------------------------------
(add/remove: 1/6 grow/shrink: 3/6 up/down: 144/-358) Total: -214 bytes
Diffstat (limited to 'libbb/change_identity.c')
-rw-r--r-- | libbb/change_identity.c | 14 |
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 @@ | |||
30 | 30 | ||
31 | #include "libbb.h" | 31 | #include "libbb.h" |
32 | 32 | ||
33 | |||
34 | /* Become the user and group(s) specified by PW. */ | 33 | /* Become the user and group(s) specified by PW. */ |
35 | const char *change_identity_e2str(const struct passwd *pw) | 34 | void change_identity(const struct passwd *pw) |
36 | { | 35 | { |
37 | if (initgroups(pw->pw_name, pw->pw_gid) == -1) | 36 | if (initgroups(pw->pw_name, pw->pw_gid) == -1) |
38 | return "cannot set groups"; | 37 | bb_perror_msg_and_die("can't set groups"); |
39 | endgrent(); /* ?? */ | 38 | endgrent(); /* ?? */ |
40 | xsetgid(pw->pw_gid); | 39 | xsetgid(pw->pw_gid); |
41 | xsetuid(pw->pw_uid); | 40 | xsetuid(pw->pw_uid); |
42 | return NULL; | ||
43 | } | ||
44 | |||
45 | void change_identity(const struct passwd *pw) | ||
46 | { | ||
47 | const char *err_msg = change_identity_e2str(pw); | ||
48 | |||
49 | if (err_msg) | ||
50 | bb_simple_perror_msg_and_die(err_msg); | ||
51 | } | 41 | } |