summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-10-01 17:01:21 +0000
committerGerald Carter <jerry@samba.org>2003-10-01 17:01:21 +0000
commitb526d07d54b40741a8f1967c90cef6511ebaeece (patch)
tree9c60622add464456725fb5ffa6df49d89cd28120 /source3/lib
parent60c8778a6099d6cf759880aeedead0a9e04bdf16 (diff)
downloadsamba-b526d07d54b40741a8f1967c90cef6511ebaeece.tar.gz
samba-b526d07d54b40741a8f1967c90cef6511ebaeece.tar.bz2
samba-b526d07d54b40741a8f1967c90cef6511ebaeece.zip
wrap internals of sys_setgroups() so the sys_XX() call can be done unconditionally; bug 550
(This used to be commit 9df3f53e6ae751d522c7ac21deb785f1fa05f225)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c8
-rw-r--r--source3/lib/system_smbd.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index b020a20373..2e95efec79 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -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()
****************************************************************************/
diff --git a/source3/lib/system_smbd.c b/source3/lib/system_smbd.c
index bcbc8c61e6..73c910e631 100644
--- a/source3/lib/system_smbd.c
+++ b/source3/lib/system_smbd.c
@@ -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");