Summary about work on id

Tito farmatito at tiscali.it
Fri Sep 19 07:03:43 UTC 2008


On Friday 19 September 2008 00:54:12 Denys Vlasenko wrote:
> On Thursday 18 September 2008 09:08, Tito wrote:
> > > I just committed the version which uses getgrouplist() and thus should
> > > work even on glibc systems with LDAP-based user database etc.
> > > 
> > > Implemented getgrouplist() in libpwdgrp, so CONFIG_USE_BB_PWD_GRP=y
> > > works. CONFIG_USE_BB_PWD_GRP=n + uclibc doesn't work yet, uclibc
> > > does not have getgrouplist().
> > > 
> > > Please take a look at current svn.
> > 
> > thanks for adding getgrouplist to libpwdgrp.
> > I will resync my work (tonight?) with svn and apply yours
> > and Vladimir's hints and prepare a series (if possible) of patches to:
> > 1) move all the IFDEF's in bb_getgrouplist;
> 
> You mean that it will return zero-sized vector on
> libc'es which have no getgrouplist()? Or what
> will it do in this case?

Return llist* list = NULL (gid_t *gid = NULL havent decide yet) in case
of whatever error could happen
included missing the needed function calls so that later in id
you can do :

if (group_list)
	print_full(..........)

BTW: I tested a weird idea to add -1 to a gid_t *gid list
as last element and easily spottable terminator.
This used somehow to work by testing 
	while(*gid != -1)    /* (  *gid < 0 didn't work) */
		do_stuff(gid++)

But i suppose that is not a GOOD THING(TM)......  8)
> 
> One possible thing is - if getgrouplist() is not available
> and if !ENABLE_USE_BB_PWD_GRP, have _another_ getgrouplist()
> implementation in id.c which uses getgrent() to iterate
> over all groups and find which groups this user is in
> (as opposed to one which opens "/etc/groups").

A question arises: is there getgrent (and endgrent) in uclibc?

> 
> This way, it will work on any libc, even one which has
> user database not in "/etc/groups".
> 
> > 	a) this could then eventually be moved to libbb
> > 	b) is it possible to use my /etc/group only version if we don't have getgrouplist?
> 
> But we have it now, in libpwdgrp. If you want to use
> /etc/* files, just select USE_BB_PWD_GRP.
> 
> > 	c) I would like to use llist_t as return value as it makes parsing the list easier and saves size.
> 
> > 2) add euid egid handling (for full SuSv3 compliance)
> 
> Yes! :)
> 
> > 3) some minor size optimizations. 
> 
> Always welcome.
> --
> vda
> 

Ciao,
Tito




More information about the busybox mailing list