logic error in sys_bsd_setgroups?
Björn JACKE
bj at SerNet.DE
Thu Jun 21 15:09:15 GMT 2007
Hi James,
while debugging some problems with the FreeBSD setgroups() workaround today
I found in sys_bsd_setgroups():
#if defined(BROKEN_GETGROUPS)
ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset);
#else
ret = setgroups(setlen, new_gidset ? new_gidset : gidset);
#endif
I think BROKEN_GETGROUPS should be HAVE_BROKEN_GETGROUPS, sholdn't it?
Then taking a look at sys_setgroups():
int sys_setgroups(gid_t UNUSED(primary_gid), int setlen, gid_t *gidset)
{
#if !defined(HAVE_SETGROUPS)
errno = ENOSYS;
return -1;
#endif /* HAVE_SETGROUPS */
#if defined(HAVE_BROKEN_GETGROUPS)
return sys_broken_setgroups(setlen, gidset);
#elif defined(USE_BSD_SETGROUPS)
return sys_bsd_setgroups(primary_gid, setlen, gidset);
#else
return setgroups(setlen, gidset);
#endif
}
... when we HAVE_BROKEN_GETGROUPS sys_bsd_setgroups isn't called at all. But
why do we check for BROKEN_GETGROUPS in sys_bsd_setgroups then?
thanks ...
Bjoern
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
More information about the samba-technical
mailing list