aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-12-23 02:42:26 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-12-23 02:42:26 +0100
commit9cc3d3ab21eb8b4766b71dffb04132184c754f7b (patch)
tree11ebefbc2a008c9479110177d97c346893ba4d82 /libbb/appletlib.c
parent7c5dea399b16341ead146cb86eb4f6cde031a12d (diff)
downloadbusybox-w32-9cc3d3ab21eb8b4766b71dffb04132184c754f7b.tar.gz
busybox-w32-9cc3d3ab21eb8b4766b71dffb04132184c754f7b.tar.bz2
busybox-w32-9cc3d3ab21eb8b4766b71dffb04132184c754f7b.zip
fix breakage found by mass one-applet builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
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 9425c7bd4..ee8b4ec14 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -329,21 +329,6 @@ static struct suid_config_t {
329 329
330static bool suid_cfg_readable; 330static bool suid_cfg_readable;
331 331
332/* check if u is member of group g */
333static int ingroup(uid_t u, gid_t g)
334{
335 struct group *grp = getgrgid(g);
336 if (grp) {
337 char **mem;
338 for (mem = grp->gr_mem; *mem; mem++) {
339 struct passwd *pwd = getpwnam(*mem);
340 if (pwd && (pwd->pw_uid == u))
341 return 1;
342 }
343 }
344 return 0;
345}
346
347/* libbb candidate */ 332/* libbb candidate */
348static char *get_trimmed_slice(char *s, char *e) 333static char *get_trimmed_slice(char *s, char *e)
349{ 334{
@@ -568,7 +553,22 @@ static inline void parse_config_file(void)
568# endif /* FEATURE_SUID_CONFIG */ 553# endif /* FEATURE_SUID_CONFIG */
569 554
570 555
571# if ENABLE_FEATURE_SUID 556# if ENABLE_FEATURE_SUID && NUM_APPLETS > 0
557/* check if u is member of group g */
558static int ingroup(uid_t u, gid_t g)
559{
560 struct group *grp = getgrgid(g);
561 if (grp) {
562 char **mem;
563 for (mem = grp->gr_mem; *mem; mem++) {
564 struct passwd *pwd = getpwnam(*mem);
565 if (pwd && (pwd->pw_uid == u))
566 return 1;
567 }
568 }
569 return 0;
570}
571
572static void check_suid(int applet_no) 572static void check_suid(int applet_no)
573{ 573{
574 gid_t rgid; /* real gid */ 574 gid_t rgid; /* real gid */