odd issue when running dbus-launch [cause found, but no fix found yet]

Vulpes Velox v.velox at vvelox.net
Mon Dec 18 00:22:08 PST 2006


On Mon, 18 Dec 2006 08:16:48 +0100
Thiago Macieira <thiago at kde.org> wrote:

> Vulpes Velox wrote:
> >> > Can you put a breakpoint in the fill_user_info function around
> >> > the calls to getgrouplist and tell us what it is doing wrong?
> >> > I can't spot the problem...
> >>
> >> Found the issue.
> >>
> >>
> >> Int ng is smaller than the number of groups a user is in. If I
> >> increase it the problem goes away.
> >
> >It is not the best solution by the farthest, but it is slightly
> >fixed by including sys/syslimits.h and setting ng to NGROUPS_MAX.
> >
> >This still sets a max upper limit though, but atleast sets it to
> >what the system assumes it to be.
> 
> There's no variable named ng in dbus-sysdeps-unix.c

That was in regards to the code snip it you sent me.

I did find the same problem in the dbus code though. After looking at
dbus-sysdeps-unix.c, I found there was a integer named buf_count
being used in the same way you used the the integer variable named ng.

After including sys/syslimits.h in dbus-sysdeps-unix.c and setting it
to set buf_count equal to NGROUPS_MAX, dbus now works properly for a
user that is a member of more than 16 groups. The buf_count is set to
17, but it is 16 because the user's main group is getting included
twice.


More information about the dbus mailing list