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

Commit f38e182f authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Maciej Żenczykowski
Browse files

Make the SocketListener control pipe O_CLOEXEC.



Children of processes that use SocketListener should not be able
to stop the SocketListener.

Test: builds, boots
Test: atest libsysutils_tests
Test: atest --test-mapping system/netd
Bug: 131268436
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: I64898d9966f62004468b8e8a43b59be4a81a8cc4
Merged-In: I64898d9966f62004468b8e8a43b59be4a81a8cc4
(cherry picked from commit dae01953)
parent b562e685
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ int SocketListener::startListener(int backlog) {
    } else if (!mListen)
        mClients[mSock] = new SocketClient(mSock, false, mUseCmdNum);

    if (pipe(mCtrlPipe)) {
    if (pipe2(mCtrlPipe, O_CLOEXEC)) {
        SLOGE("pipe failed (%s)", strerror(errno));
        return -1;
    }