inetd: fix for running by non-root
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 9 Nov 2017 15:19:42 +0000 (16:19 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 9 Nov 2017 15:19:42 +0000 (16:19 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/inetd.c

index 67984accb56f297babb293b43af66cf8cd5cdc0c..4dfa0089a6c92934182bfb5b09d5c0058a8c2811 100644 (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: */