Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfb5ec3c authored by Rom Lemarchand's avatar Rom Lemarchand
Browse files

logwrap: remove unnecessary call to setuid/setgid

Android allows all users to write to log.
The setuid/setgid call is unneeded and could cause unintended
side effects when called from daemons or programs that need
to run as root.

Change-Id: I3bdb26eaa4363ef037615e45a1a5cb1ceb4088f3
parent 611f5b4b
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -262,12 +262,6 @@ int logwrap(int argc, char* argv[], int *status) {

        signal_fd_write = sockets[0];

        // switch user and group to "log"
        // this may fail if we are not root,
        // but in that case switching user/group is unnecessary
        setgid(AID_LOG);
        setuid(AID_LOG);

        rc = parent(argv[0], parent_ptty, sockets[1], pid, status);
    }