[Toybox] [PATCH] id: various fixes.

Rob Landley rob at landley.net
Mon Nov 4 20:14:06 PST 2019



On 11/4/19 12:43 PM, enh via Toybox wrote:
> Handle unknown groups (fixes #117).
> 
> Fix -G to show *all* groups, not just all supplementary groups.
> 
> Fix -Z output to not include "context=".

Sigh:

-  if (!FLAG(Z)) {
+  if (!(toys.optflags&(FLAG_g|FLAG_Z))) {

I need some kind of FLAGS(Z,g) syntax, but have no idea how to get the
preprocessor to do that. Hmmm...

+        if (groups[i] != egid) {
+          if ((grp=getgrgid(groups[i]))) showid(",", grp->gr_gid, grp->gr_name);
+          else printf(",%u", groups[i]);

Does this mean if the first group you show is unknown, it'll have a comma before it?

Applied anyway,


Rob


> ---
>  tests/id.test   |  3 +++
>  toys/posix/id.c | 53 +++++++++++++++++++++----------------------------
>  2 files changed, 26 insertions(+), 30 deletions(-)
> 
> 
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
> 



More information about the Toybox mailing list