odd issue when running dbus-launch [patch to fix]

Vulpes Velox v.velox at vvelox.net
Tue Jan 2 00:09:05 PST 2007


On Mon, 1 Jan 2007 18:14:45 -0600
Vulpes Velox <v.velox at vvelox.net> wrote:

> On Mon, 1 Jan 2007 21:10:43 -0200
> Thiago Macieira <thiago at kde.org> wrote:
> 
> > Vulpes Velox wrote:
> > >As to the question of glibc, I am not seeing where this actually
> > >uses glibc.
> > 
> > getgrouplist is a glibc function.
> 
> Standard libc function actually.
> 
> > >I am curious, what function is failing? I see getgrouplist is
> > >working entirely properly.
> > 
> > No, it isn't.
> > 
> > RETURN VALUE
> >    If *ngroups is smaller than the total number of groups found,
> > then get‐ grouplist() returns a value of ‘-1'.  In all cases the
> > actual number of groups is stored in *ngroups.
> > 
> > Your getgrouplist isn't storing the actual number of groups in
> > *ngroups. Your tests proved that.
> > 
> > >I am not seeing any attempts in dbus-sysdeps-unix.c to properly
> > >set buf_count. It is set at 17 and never changed after that. The
> > >problem with this is it limits some one to only 16 groups.
> > 
> > Exactly. getgrouplist is supposed to set it.
> 
> Hmm, just reread part of that. I will check a bit more in that
> direction.


Nope. Got looking at the docs for getgrouplist closer. Yeah, it is
functioning properly. *ngroups is not set to the number of users in a
group, if *ngroups the initial value of *ngroups is smaller than the
number of groups the user is a member of. Looking at the docs for the
libc used by FreeBSD and what ever you pulled that from, it looks
like getgrouplist does not function exactly the same in the two.

http://www.freebsd.org/cgi/man.cgi?query=getgrouplist&apropos=0&sektion=0&manpath=FreeBSD+6.1-RELEASE&format=html

I have created a nicer patch that does involves less change. Upon it
first initially failing, it now uses getgroups to find the number of
groups. This is only a one line change and is less invasive than the
previous one.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-sysdeps-unix.c.patch-2
Type: application/octet-stream
Size: 395 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070102/14f2b335/dbus-sysdeps-unix.c.obj


More information about the dbus mailing list