hush/loginutils
Eric Andersen 7eb79fff10 Tito writes:
Hi Erik,
Hi to all,
This is part five of the my_get*id story.
I've tweaked a bit this two functions to make them more flexible,
but this changes will not affect existing code.
Now they work so:
1) my_getpwuid( char *user, uid_t uid, int bufsize)

   if bufsize is > 0 char *user cannot be set to NULL
                     on success username is written on static allocated buffer
                     on failure uid as string is written to buffer and NULL is returned
   if bufsize is = 0 char *user can be set to NULL
                     on success username is returned
                     on failure NULL is returned
   if bufsize is < 0 char *user can be set to NULL
                     on success username is returned
                     on failure an error message is printed and the program exits

  2) 1) my_getgrgid( char *group, uid_t uid, int bufsize)

   if bufsize is > 0 char *group cannot be set to NULL
                     on success groupname is written on static allocated buffer
                     on failure gid as string is written to buffer and NULL is returned
   if bufsize is = 0 char *group can be set to NULL
                     on success groupname is returned
                     on failure NULL is returned
   if bufsize is < 0 char *group can be set to nULL
                     on success groupname is returned
                     on failure an error message is printed and the program exits

This changes were needed mainly for my new id applet.
It is somewhat bigger then the previous but matches the behaviour of GNU id
and is capable to handle usernames of whatever length.
BTW: at a first look it seems to me that it will integrate well (with just a few changes)
with the pending patch  in patches/id_groups_alias.patch.
The increase in size is balanced by the removal of my_getpwnamegid.c
from libbb as this was used only in previous id applet and by size optimizations
made possible in whoami.c and in passwd.c.
I know that we are in feature freeze but I think that i've tested it enough
(at least I hope so.......).
2004-09-02 22:21:41 +00:00
..
addgroup.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
adduser.c Bertrand Baudet writes: 2004-08-16 09:07:39 +00:00
Config.in Improve the setuid situation a bit, and make it more apparent 2004-08-26 23:13:00 +00:00
delgroup.c Looks like I forgot one little tiny detail... 2003-07-14 21:50:51 +00:00
delline.c Looks like I forgot one little tiny detail... 2003-07-14 21:50:51 +00:00
deluser.c decouple delgroup and deluser 2003-07-14 20:20:45 +00:00
getty.c Save a line or two 2004-08-26 22:26:26 +00:00
login.c Save a line or two 2004-08-26 22:26:26 +00:00
Makefile Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Makefile.in passwd and sulogin also need libcrypt, via libbb/pw_encrypt() 2004-03-27 10:08:53 +00:00
passwd.c Tito writes: 2004-09-02 22:21:41 +00:00
su.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
sulogin.c Do not use getpass(3) 2004-05-01 01:27:30 +00:00
vlock.c Do not use getpass(3) 2004-05-01 01:27:30 +00:00