diff options
author | Mathias Agopian <mathias@google.com> | 2013-04-18 16:41:04 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2013-04-18 16:41:04 -0700 |
commit | bd1153382e7a9d89922bea999a52ca21d46d6caa (patch) | |
tree | 6e82406fce0cb57d1709f528c07433e3c9218183 /services | |
parent | 379f0f04cca66b5fe3dcd96ef81b267d8fc0de03 (diff) | |
download | frameworks_native-bd1153382e7a9d89922bea999a52ca21d46d6caa.zip frameworks_native-bd1153382e7a9d89922bea999a52ca21d46d6caa.tar.gz frameworks_native-bd1153382e7a9d89922bea999a52ca21d46d6caa.tar.bz2 |
allow dumpsys SurfaceFlinger in user builds from the shell user
Bug: 8659013
Change-Id: I1de43bb5808cb8c1103cfc73dca59ff70fc13f91
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index dc29e48..e647275 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2145,11 +2145,14 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args) char buffer[SIZE]; String8 result; - if (!PermissionCache::checkCallingPermission(sDump)) { + + IPCThreadState* ipc = IPCThreadState::self(); + const int pid = ipc->getCallingPid(); + const int uid = ipc->getCallingUid(); + if ((uid != AID_SHELL) && + !PermissionCache::checkPermission(sDump, pid, uid)) { snprintf(buffer, SIZE, "Permission Denial: " - "can't dump SurfaceFlinger from pid=%d, uid=%d\n", - IPCThreadState::self()->getCallingPid(), - IPCThreadState::self()->getCallingUid()); + "can't dump SurfaceFlinger from pid=%d, uid=%d\n", pid, uid); result.append(buffer); } else { // Try to get the main lock, but don't insist if we can't |