inetd: fix for running by non-root

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-11-09 16:19:42 +01:00
parent 1b510900e2
commit 2fee2bce6f

View File

@ -1488,7 +1488,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
bb_error_msg("non-root must run services as himself");
goto do_exit1;
}
if (pwd->pw_uid != 0) {
if (pwd->pw_uid != real_uid) {
if (sep->se_group)
pwd->pw_gid = grp->gr_gid;
/* initgroups, setgid, setuid: */