aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libbb.h4
-rw-r--r--libbb/bb_getgroups.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index ff4a67481..11d52c08c 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1273,7 +1273,11 @@ struct cached_groupinfo {
1273}; 1273};
1274uid_t FAST_FUNC get_cached_euid(uid_t *euid); 1274uid_t FAST_FUNC get_cached_euid(uid_t *euid);
1275gid_t FAST_FUNC get_cached_egid(gid_t *egid); 1275gid_t FAST_FUNC get_cached_egid(gid_t *egid);
1276#if !ENABLE_PLATFORM_MINGW32
1276int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid_t gid); 1277int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid_t gid);
1278#else
1279# define is_in_supplementary_groups(g, i) (FALSE)
1280#endif
1277 1281
1278#if ENABLE_FEATURE_UTMP 1282#if ENABLE_FEATURE_UTMP
1279void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname); 1283void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname);
diff --git a/libbb/bb_getgroups.c b/libbb/bb_getgroups.c
index 31cff2b41..c255d4e4c 100644
--- a/libbb/bb_getgroups.c
+++ b/libbb/bb_getgroups.c
@@ -60,6 +60,11 @@ gid_t FAST_FUNC get_cached_egid(gid_t *egid)
60 return *egid; 60 return *egid;
61} 61}
62 62
63#if !ENABLE_PLATFORM_MINGW32
64// Both current callers of is_in_supplementary_groups() check the gid
65// first. Our implementation of getgroups() provides no additional
66// information so there's no reason to call it.
67
63/* Return non-zero if GID is in our supplementary group list. */ 68/* 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) 69int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid_t gid)
65{ 70{
@@ -79,3 +84,4 @@ int FAST_FUNC is_in_supplementary_groups(struct cached_groupinfo *groupinfo, gid
79 84
80 return 0; 85 return 0;
81} 86}
87#endif