mirror of
https://github.com/samba-team/samba.git
synced 2025-03-11 16:58:40 +03:00
wrap internals of sys_setgroups() so the sys_XX() call can be done unconditionally; bug 550
(This used to be commit 9df3f53e6ae751d522c7ac21deb785f1fa05f225)
This commit is contained in:
parent
60c8778a60
commit
b526d07d54
@ -693,7 +693,6 @@ int sys_getgroups(int setlen, gid_t *gidset)
|
||||
#endif /* HAVE_BROKEN_GETGROUPS */
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETGROUPS
|
||||
|
||||
/**************************************************************************
|
||||
Wrapper for setgroups. Deals with broken (int) case. Automatically used
|
||||
@ -702,6 +701,11 @@ int sys_getgroups(int setlen, gid_t *gidset)
|
||||
|
||||
int sys_setgroups(int setlen, gid_t *gidset)
|
||||
{
|
||||
#if !defined(HAVE_SETGROUPS)
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
#endif /* HAVE_SETGROUPS */
|
||||
|
||||
#if !defined(HAVE_BROKEN_GETGROUPS)
|
||||
return setgroups(setlen, gidset);
|
||||
#else
|
||||
@ -742,8 +746,6 @@ int sys_setgroups(int setlen, gid_t *gidset)
|
||||
#endif /* HAVE_BROKEN_GETGROUPS */
|
||||
}
|
||||
|
||||
#endif /* HAVE_SETGROUPS */
|
||||
|
||||
/**************************************************************************
|
||||
Wrappers for setpwent(), getpwent() and endpwent()
|
||||
****************************************************************************/
|
||||
|
@ -92,7 +92,7 @@ static int getgrouplist_internals(const char *user, gid_t gid, gid_t *groups, in
|
||||
|
||||
restore_re_gid();
|
||||
|
||||
if (setgroups(ngrp_saved, gids_saved) != 0) {
|
||||
if (sys_setgroups(ngrp_saved, gids_saved) != 0) {
|
||||
/* yikes! */
|
||||
DEBUG(0,("ERROR: getgrouplist: failed to reset group list!\n"));
|
||||
smb_panic("getgrouplist: failed to reset group list!\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user