aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-03-24 11:55:30 +0000
committerRon Yorston <rmy@pobox.com>2021-03-24 12:43:15 +0000
commit355a7a6c1e9626b7afe8758a6095f3cf275c52e1 (patch)
tree6dab679c15b049cab97212e0b43077132eec1fbe /libbb/appletlib.c
parent71ecc8033e6989996057b32577e71148fd544596 (diff)
parent889425812b5cda8b3394d73253cbde7355fb1115 (diff)
downloadbusybox-w32-w32_1_26_2.tar.gz
busybox-w32-w32_1_26_2.tar.bz2
busybox-w32-w32_1_26_2.zip
Merge tag '1_26_2' into w32_1_26_2w32_1_26_2
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 1fe0eb44f..ac3e414f5 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -334,21 +334,6 @@ static struct suid_config_t {
334 334
335static bool suid_cfg_readable; 335static bool suid_cfg_readable;
336 336
337/* check if u is member of group g */
338static int ingroup(uid_t u, gid_t g)
339{
340 struct group *grp = getgrgid(g);
341 if (grp) {
342 char **mem;
343 for (mem = grp->gr_mem; *mem; mem++) {
344 struct passwd *pwd = getpwnam(*mem);
345 if (pwd && (pwd->pw_uid == u))
346 return 1;
347 }
348 }
349 return 0;
350}
351
352/* libbb candidate */ 337/* libbb candidate */
353static char *get_trimmed_slice(char *s, char *e) 338static char *get_trimmed_slice(char *s, char *e)
354{ 339{
@@ -573,7 +558,22 @@ static inline void parse_config_file(void)
573# endif /* FEATURE_SUID_CONFIG */ 558# endif /* FEATURE_SUID_CONFIG */
574 559
575 560
576# if ENABLE_FEATURE_SUID 561# if ENABLE_FEATURE_SUID && NUM_APPLETS > 0
562/* check if u is member of group g */
563static int ingroup(uid_t u, gid_t g)
564{
565 struct group *grp = getgrgid(g);
566 if (grp) {
567 char **mem;
568 for (mem = grp->gr_mem; *mem; mem++) {
569 struct passwd *pwd = getpwnam(*mem);
570 if (pwd && (pwd->pw_uid == u))
571 return 1;
572 }
573 }
574 return 0;
575}
576
577static void check_suid(int applet_no) 577static void check_suid(int applet_no)
578{ 578{
579 gid_t rgid; /* real gid */ 579 gid_t rgid; /* real gid */