aboutsummaryrefslogtreecommitdiff
path: root/libbb/bb_pwd.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-03 19:00:01 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-03 19:03:32 +0200
commit39194f030918b87eeb3e11e94cfa05f575fb47b4 (patch)
tree97ea35e2c5984c5c6757ff9a540630ada4b234d5 /libbb/bb_pwd.c
parent663ae52676eae3b0fdc6bb968ff6497279a034a4 (diff)
downloadbusybox-w32-39194f030918b87eeb3e11e94cfa05f575fb47b4.tar.gz
busybox-w32-39194f030918b87eeb3e11e94cfa05f575fb47b4.tar.bz2
busybox-w32-39194f030918b87eeb3e11e94cfa05f575fb47b4.zip
new NOFORKs: pwdx,kill[all5],ttysize,realpath,readlink NOEXECs: date,resize
function old new delta run_nofork_applet 258 280 +22 readlink_main 112 123 +11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/bb_pwd.c')
-rw-r--r--libbb/bb_pwd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/bb_pwd.c b/libbb/bb_pwd.c
index 4829b723a..dca0a150b 100644
--- a/libbb/bb_pwd.c
+++ b/libbb/bb_pwd.c
@@ -31,9 +31,9 @@ struct group* FAST_FUNC xgetgrnam(const char *name)
31 return gr; 31 return gr;
32} 32}
33 33
34
35struct passwd* FAST_FUNC xgetpwuid(uid_t uid) 34struct passwd* FAST_FUNC xgetpwuid(uid_t uid)
36{ 35{
36 /* Note: used in nofork applets (whoami), be careful not to leak anything */
37 struct passwd *pw = getpwuid(uid); 37 struct passwd *pw = getpwuid(uid);
38 if (!pw) 38 if (!pw)
39 bb_error_msg_and_die("unknown uid %u", (unsigned)uid); 39 bb_error_msg_and_die("unknown uid %u", (unsigned)uid);
@@ -50,6 +50,7 @@ struct group* FAST_FUNC xgetgrgid(gid_t gid)
50 50
51char* FAST_FUNC xuid2uname(uid_t uid) 51char* FAST_FUNC xuid2uname(uid_t uid)
52{ 52{
53 /* Note: used in nofork applets (whoami), be careful not to leak anything */
53 struct passwd *pw = xgetpwuid(uid); 54 struct passwd *pw = xgetpwuid(uid);
54 return pw->pw_name; 55 return pw->pw_name;
55} 56}