diff options
| author | 2022-09-13 23:48:24 +0000 | |
|---|---|---|
| committer | 2022-09-13 23:48:24 +0000 | |
| commit | 62028791f00f830c2229a998333b3ba3265bae3a (patch) | |
| tree | 42b6f7c81cf74262a4b7fb9d2cbaeec76f1d1e36 | |
| parent | 15c2fea937a9c68b4d3f55ee419eb747b83ee37c (diff) | |
| parent | fb310917b11aaa757059df3300f9a9d3bf45e475 (diff) | |
Merge "Don't wait on permission check." am: aa50ac1958 am: bc3792456d am: e92a7d42b5 am: 83d266f151 am: fb310917b1
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2216281
Change-Id: Ia5eff787d6db2a2587c49447115e206350dd7ca3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index a278a48135..b1283eb4a7 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -127,8 +127,6 @@ static std::once_flag flag; namespace { -constexpr const char* kDump = "android.permission.DUMP"; - static binder::Status ok() { return binder::Status::ok(); } @@ -152,19 +150,6 @@ static binder::Status error(uint32_t code, const std::string& msg) { return binder::Status::fromServiceSpecificError(code, String8(msg.c_str())); } -binder::Status checkPermission(const char* permission) { - pid_t pid; - uid_t uid; - - if (checkCallingPermission(String16(permission), reinterpret_cast<int32_t*>(&pid), - reinterpret_cast<int32_t*>(&uid))) { - return ok(); - } else { - return exception(binder::Status::EX_SECURITY, - StringPrintf("UID %d / PID %d lacks permission %s", uid, pid, permission)); - } -} - binder::Status checkUid(uid_t expectedUid) { uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid == expectedUid || uid == AID_ROOT) { @@ -402,13 +387,7 @@ status_t InstalldNativeService::start() { return android::OK; } -status_t InstalldNativeService::dump(int fd, const Vector<String16> & /* args */) { - const binder::Status dump_permission = checkPermission(kDump); - if (!dump_permission.isOk()) { - dprintf(fd, "%s\n", dump_permission.toString8().c_str()); - return PERMISSION_DENIED; - } - +status_t InstalldNativeService::dump(int fd, const Vector<String16>& /* args */) { { std::lock_guard<std::recursive_mutex> lock(mMountsLock); dprintf(fd, "Storage mounts:\n"); |