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
This commit is contained in:
Luis Hector Chavez 2018-06-13 07:35:24 -07:00
parent 0becca32bc
commit 499f3a2aed

View file

@ -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;