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

Commit 499f3a2a authored by Luis Hector Chavez's avatar Luis Hector Chavez
Browse files

logd: Stop calling prctl(PR_SET_KEEPCAPS, 1)

This change removes the call to prctl(PR_SET_KEEPCAPS, 1), because now
that logd is being run with ambient capabilities, init will set the
KEEP_CAPS / KEEP_CAPS_LOCKED securebits.

Bug: 110127913
Test: liblog-unit-tests, logd-unit-tests, logcat-unit-tests
      (on an aosp_sailfish-userdebug)

Change-Id: I72b6a49c5cd1552085f9ad44cb19a7333a13eeea
parent 0becca32
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -115,11 +115,6 @@ static int drop_privs(bool klogd, bool auditd) {
        return -1;
    }

    if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
        android::prdebug("failed to set PR_SET_KEEPCAPS");
        if (!eng) return -1;
    }

    std::unique_ptr<struct _cap_struct, int (*)(void*)> caps(cap_init(),
                                                             cap_free);
    if (cap_clear(caps.get()) < 0) return -1;