[Toybox] [PATCH] new toys groups and whoami

Rob Landley rob at landley.net
Sun Feb 26 21:03:51 PST 2012


On 02/24/2012 02:04 AM, Daniel Walter wrote:
> new toys groups and whoami
> 
>  * fixed wrong path for id (should be /usr/bin/id)
> 
> --
> comments are welcome.
> 
> regards,
> daniel
> --
>  toys/id.c |  44 ++++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 42 insertions(+), 2 deletions(-)
> --
> diff -r 42a322adbd17 toys/id.c
> --- a/toys/id.c	Tue Feb 21 21:39:20 2012 -0600
> +++ b/toys/id.c	Fri Feb 24 09:03:10 2012 +0100
> @@ -2,19 +2,23 @@
>   *
>   * id.c - print real and effective user and group IDs
>   *
> + * Copyright 2012 Daniel Walter <d.walter at 0x90at>
> + *
>   * Copyright 2012 Sony Network Entertainment, Inc.
>   *
>   * by Tim Bird <tim.bird at am.sony.com>
>   *
>   * See http://www.opengroup.org/onlinepubs/009695399/utilities/id.html
>  
> -USE_ID(NEWTOY(id, "nGgru", TOYFLAG_BIN))
> +USE_ID(NEWTOY(whoami, NULL, TOYFLAG_USR | TOYFLAG_BIN))
> +USE_ID(NEWTOY(groups, NULL, TOYFLAG_USR | TOYFLAG_BIN))
> +USE_ID(NEWTOY(id, "nGgru", TOYFLAG_USR | TOYFLAG_BIN))

The USE_ID() resolve to their contents unless CONFIG_ID is enabled, and
nothing when CONFIG_ID is disabled.  Thus all three NEWTOY() entries
will be enabled by the same CONFIG_ID symbol.

(The CONFIG_ID_WHOAMI and CONFIG_ID_GROUPS symbols you added are thus
unused.  Also, they won't show up in menuconfig unless you put a
description after the type; that's a kconfig thing.)

Hmmm...  I'm having trouble getting the function prototypes (only
created for NEWTOY() using the first field) with the help macros
(created by parsing that USE_ prefix)).  I'm going to have to do some
fiddling here.

I have to pause merging stuff again to clean up and cut a release.  (I
meant to do so this weekend, but was mostly distracted and then
finishing the killall/kill merge...)

I think I have to write more documentation on this top-of-file setup
stuff, and I need to clean up the infrastructure to support multiple
commands in the same file (which really isn't there right now...)

Rob

 1330319031.0


More information about the Toybox mailing list