aboutsummaryrefslogtreecommitdiff
path: root/libbb/bb_getgroups.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/bb_getgroups.c')
-rw-r--r--libbb/bb_getgroups.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbb/bb_getgroups.c b/libbb/bb_getgroups.c
index 31cff2b41..757b80be8 100644
--- a/libbb/bb_getgroups.c
+++ b/libbb/bb_getgroups.c
@@ -10,6 +10,7 @@
10 10
11#include "libbb.h" 11#include "libbb.h"
12 12
13#if !ENABLE_PLATFORM_MINGW32
13gid_t* FAST_FUNC bb_getgroups(int *ngroups, gid_t *group_array) 14gid_t* FAST_FUNC bb_getgroups(int *ngroups, gid_t *group_array)
14{ 15{
15 int n = ngroups ? *ngroups : 0; 16 int n = ngroups ? *ngroups : 0;
@@ -45,6 +46,7 @@ gid_t* FAST_FUNC bb_getgroups(int *ngroups, gid_t *group_array)
45 *ngroups = n; 46 *ngroups = n;
46 return group_array; 47 return group_array;
47} 48}
49#endif
48 50
49uid_t FAST_FUNC get_cached_euid(uid_t *euid) 51uid_t FAST_FUNC get_cached_euid(uid_t *euid)
50{ 52{
@@ -60,6 +62,11 @@ gid_t FAST_FUNC get_cached_egid(gid_t *egid)
60 return *egid; 62 return *egid;
61} 63}
62 64
65#if !ENABLE_PLATFORM_MINGW32
66// Both current callers of is_in_supplementary_groups() check the gid
67// first. Our implementation of getgroups() provides no additional
68// information so there's no reason to call it.
69
63/* Return non-zero if GID is in our supplementary group list. */ 70/* Return non-zero if GID is in our supplementary group list. */
64int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid_t gid) 71int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid_t gid)
65{ 72{
@@ -79,3 +86,4 @@ int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid
79 86
80 return 0; 87 return 0;
81} 88}
89#endif