aboutsummaryrefslogtreecommitdiff
path: root/loginutils/deluser.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-02-07 21:21:02 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-02-07 21:21:02 +0100
commit23cfaab47de7392c1ba7d601a05fb36da3629b28 (patch)
tree228cbefac14b7e60edda2e9314a30bfd43a7e5c5 /loginutils/deluser.c
parent68c048fb23bd8b0831bbd02ec66900b12390cf19 (diff)
downloadbusybox-w32-23cfaab47de7392c1ba7d601a05fb36da3629b28.tar.gz
busybox-w32-23cfaab47de7392c1ba7d601a05fb36da3629b28.tar.bz2
busybox-w32-23cfaab47de7392c1ba7d601a05fb36da3629b28.zip
libpwdgrp: use getpwent() instead of getpwent_r()
function old new delta massage_data_for_non_r_func - 90 +90 bb_internal_getpwent - 69 +69 getXXnam_r 94 162 +68 fill_bounds 131 128 -3 deluser_main 355 310 -45 complete_username 123 78 -45 getXXnam 163 90 -73 massage_data_for_r_func 103 - -103 bb_internal_getpwent_r 121 - -121 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 1/5 up/down: 227/-407) Total: -163 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/deluser.c')
-rw-r--r--loginutils/deluser.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index 2d98ecc58..01a9386bc 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -91,12 +91,11 @@ int deluser_main(int argc, char **argv)
91 if (!member) { 91 if (!member) {
92 /* "delgroup GROUP" */ 92 /* "delgroup GROUP" */
93 struct passwd *pw; 93 struct passwd *pw;
94 struct passwd pwent;
95 /* Check if the group is in use */ 94 /* Check if the group is in use */
96#define passwd_buf bb_common_bufsiz1 95 while ((pw = getpwent()) != NULL) {
97 while (!getpwent_r(&pwent, passwd_buf, sizeof(passwd_buf), &pw)) { 96 if (pw->pw_gid == gr->gr_gid)
98 if (pwent.pw_gid == gr->gr_gid) 97 bb_error_msg_and_die("'%s' still has '%s' as their primary group!",
99 bb_error_msg_and_die("'%s' still has '%s' as their primary group!", pwent.pw_name, name); 98 pw->pw_name, name);
100 } 99 }
101 //endpwent(); 100 //endpwent();
102 } 101 }