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

Commit 06b54085 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Automerger Merge Worker
Browse files

Merge "Don't depend on private/android_filesystem_config.h" into main am:...

Merge "Don't depend on private/android_filesystem_config.h" into main am: 09899bc0 am: 33fb10a5 am: 5a9b7bbc am: 15c071f6

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2779434



Change-Id: I109663f0234e1fea006b168d675a8f8d59218555
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a6da34a3 15c071f6
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@
#include <binder/Parcel.h>
#include <binder/RecordedTransaction.h>
#include <binder/RpcServer.h>
#include <private/android_filesystem_config.h>
#include <pthread.h>
#include <utils/misc.h>

@@ -45,6 +44,8 @@

namespace android {

constexpr uid_t kUidRoot = 0;

// Service implementations inherit from BBinder and IBinder, and this is frozen
// in prebuilts.
#ifdef __LP64__
@@ -300,7 +301,7 @@ status_t BBinder::startRecordingTransactions(const Parcel& data) {
        return INVALID_OPERATION;
    }
    uid_t uid = IPCThreadState::self()->getCallingUid();
    if (uid != AID_ROOT) {
    if (uid != kUidRoot) {
        ALOGE("Binder recording not allowed because client %" PRIu32 " is not root", uid);
        return PERMISSION_DENIED;
    }
@@ -330,7 +331,7 @@ status_t BBinder::stopRecordingTransactions() {
        return INVALID_OPERATION;
    }
    uid_t uid = IPCThreadState::self()->getCallingUid();
    if (uid != AID_ROOT) {
    if (uid != kUidRoot) {
        ALOGE("Binder recording not allowed because client %" PRIu32 " is not root", uid);
        return PERMISSION_DENIED;
    }
@@ -634,7 +635,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) {
        return INVALID_OPERATION;
    }
    uid_t uid = IPCThreadState::self()->getCallingUid();
    if (uid != AID_ROOT) {
    if (uid != kUidRoot) {
        ALOGE("%s: not allowed because client %" PRIu32 " is not root", __PRETTY_FUNCTION__, uid);
        return PERMISSION_DENIED;
    }
+7 −1
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@
#include <android/binder_status.h>
#include <binder/IPCThreadState.h>
#include <binder/IResultReceiver.h>
#if __has_include(<private/android_filesystem_config.h>)
#include <private/android_filesystem_config.h>
#endif

#include "ibinder_internal.h"
#include "parcel_internal.h"
@@ -229,7 +231,11 @@ status_t ABBinder::onTransact(transaction_code_t code, const Parcel& data, Parce

        // Shell commands should only be callable by ADB.
        uid_t uid = AIBinder_getCallingUid();
        if (uid != AID_ROOT && uid != AID_SHELL) {
        if (uid != 0 /* root */
#ifdef AID_SHELL
            && uid != AID_SHELL
#endif
        ) {
            if (resultReceiver != nullptr) {
                resultReceiver->send(-1);
            }