| Summary: | id -n -g returns 1 on groups with more then 14 members | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | falk <schoenfeld> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | busybox-cvs, schoenfeld |
| Priority: | P5 | ||
| Version: | 1.18.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | [PATCH] implement groups applet | ||
|
Description
falk
2011-03-02 15:57:43 UTC
I can't reproduce this with 0.18. $ grep mjt /etc/group | wc -l 24 $ busybox id -n -g mjt mjt $ echo $? 0 $_ This is with either built-in (in-bb) pwd&grp or using the one from glibc (ie, with or without CONFIG_USE_BB_PWD_GRP). Um, that was wrong comment. If a group has >14 members, not if a user is in >14 groups. But still no go. $ grep ^buh: /etc/group | tr , \ | wc -w 18 $ busybox id -n -g buh-owner; echo $? buh 0 $ _ Again, with and without CONFIG_USE_BB_PWD_GRP - the same effect. I testet on a OpenWRT backfire and a OpenSUSE 11.3. Below is the behavior of openwrt-system. With 18 users in a group: root@devel:~# cat /etc/group root:x:0: nogroup:x:65534: admin:x:100:eurogard user:x:101:hildgund,klomann,klofrau,milchmann,milchfrau,eiermann,eierfrau,postmann,postfrau,weihnachtsmann,weihnachtsfrau,hasenmann,hasenfrau,muellmann,muellfrau,mechthild,bechterew,miesepeter root@devel:~# busybox id -n -g milchmann; echo $? 101 1 Again with 12 user in the same group: root@devel:~# cat /etc/group root:x:0: nogroup:x:65534: admin:x:100:eurogard user:x:101:hildgund,klomann,klofrau,milchmann,milchfrau,eiermann,eierfrau,postmann,postfrau,weihnachtsmann,weihnachtsfrau,hasenmann root@devel:~# busybox id -n -g milchmann; echo $? user 0 root@devel:~# You can also see, that the -n option took no effect. Thanks for reading Was closed by mistake debian/ubuntu has the "groups" binary (/usr/bin/groups)
maybe this applet should exists in busybox too...
groups equals
busybox id -G -n
# groups --help
Usage: groups [OPTION]... [USERNAME]...
Print group memberships for each USERNAME or, if no USERNAME is specified, for
the current process (which may differ if the groups database has changed).
--help display this help and exit
--version output version information and exit
Report groups bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'groups invocation'
Created attachment 3445 [details]
[PATCH] implement groups applet
as a wrapper to id special syntax :
+int groups_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int groups_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
+{
+ if (argv[1])
+ bb_show_usage();
+
+ char *id_argv[4];
+ id_argv[0] = xstrdup("id");
+ id_argv[1] = xstrdup("-G");
+ id_argv[2] = xstrdup("-n");
+ id_argv[3] = 0;
+
+ return id_main(3, id_argv);
+}
Fixed in 1.19.x |