[Toybox] add groups implementation to id.c

Rob Landley rob at landley.net
Mon May 13 22:37:03 PDT 2013


On 05/11/2013 05:25:26 AM, Ivo van Poorten wrote:
> Hi,
> 
> Stilling getting familiar with the toybox infrastructure. Here's a
> simple addition to begin with.

Cool. (Applied.)

> To discuss:
> 
> 1. for 'groups username' FSF's groups prints the username and a colon
> at the start of the line. The LSB does not specifically describes
> that. Should we stay compatible with GNU coreutils or not?

I give fairly significant weight to what posix says, but treat LSB as a  
suggestion.

I don't specifically care about GNU anything, but I do care what's  
installed on existing Linux systems. Thus if that's what the version on  
Ubuntu and SuSE and Gentoo and such do, then it's probably what we  
should do unless the functionality isn't worth the complexity.

> 2. FSF's groups accepts more than one username, which is not conform
> the LSB's description, which states one optional user argument.

It's reasonably straightforward to add via loopfiles(). See  
toys/posix/wc.c for example.

> 3. id is in posix/ and groups is from the LSB. If we decide to ignore
> coreutils, groups could move to lsb/ and call id -Gn [user].

Sigh, I looked at adding "groups" to "id" back in... february?   
Rummage, rummage...

   http://landley.net/notes-2013.html#30-01-2013

Looks like I got part of the infrastructure updated, then got  
distracted. (I'd love to work on toybox full-time for a year or so and  
actually get it to 1.0. Alas, I now have a real house and a wife in  
college and am actually paying for health insurance instead of just  
hoping I don't get sick, and it adds up. Thus I keep working on other  
things to pay the bills.)

I'm fine with a posix entry doing extra stuff. The menuconfig  
subdirectories are partly there so we don't have one big unmanageable  
pile of hundreds of commands, but the actual trigger for the split was  
so I didn't have to annotate every individual command's menuconfig help  
text with whether it's from posix or lsb (and then filter it OUT so it  
doesn't show up in the --help text that's generated from that).

There are also some limitations in the toybox shared infrastructure,  
one of which is that when you have an OLDTOY you don't get FLAG_x  
macros for it. Another is that I vaguely plan to do an "every toybox  
command as a separate binary" build mode (like I did for busybox way  
back), and I haven't decided whether OLDTOY entries should get built  
separately or still be hardlinked in that case.

That's probably how I got distracted from finishing this months ago. (I  
don't _think_ there's any lurking major design gotchas. Not since
http://landley.net/hg/toybox/rev/796 anyway...)

> Regards,
> Ivo

Rob


More information about the Toybox mailing list