aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-05 16:23:06 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-05 16:23:06 +0000
commit15437e3e2a0cc9e4ba25066fd562b2862d38799b (patch)
tree5093eddb8a8dd3ae6edd564e43f6219be3fd9a08 /loginutils
parentd324e1b808daca7eec5b8700824a886a21508714 (diff)
downloadbusybox-15437e3e2a0cc9e4ba25066fd562b2862d38799b.tar.gz
libbb: add xgetgrnam too. ~0 code size change
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/addgroup.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 2a840d7c0..5032d7b99 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -158,10 +158,8 @@ int addgroup_main(int argc UNUSED_PARAM, char **argv)
/* check if group and user exist */
xuname2uid(argv[0]); /* unknown user: exit */
- xgroup2gid(argv[1]); /* unknown group: exit */
-// race here!
+ gr = xgetgrnam(argv[1]); /* unknown group: exit */
/* check if user is already in this group */
- gr = getgrnam(argv[1]);
for (; *(gr->gr_mem) != NULL; (gr->gr_mem)++) {
if (!strcmp(argv[0], *(gr->gr_mem))) {
/* user is already in group: do nothing */