Skip to content
Snippets Groups Projects
Commit 868bc803 authored by Kunal Malhotra's avatar Kunal Malhotra Committed by Automerger Merge Worker
Browse files

Merge "Adding in verification of calling UID in onShellCommand" into rvc-dev...

Merge "Adding in verification of calling UID in onShellCommand" into rvc-dev am: 7c905e10 am: ca34073d am: 8f6b8d31

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24058898



Change-Id: Ibb59b8e6a61f60ddf4c45ebece8814a82fc89fdf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8efa785f 8f6b8d31
No related branches found
No related tags found
No related merge requests found
......@@ -8674,6 +8674,13 @@ public class ActivityManagerService extends IActivityManager.Stub
public void onShellCommand(FileDescriptor in, FileDescriptor out,
FileDescriptor err, String[] args, ShellCallback callback,
ResultReceiver resultReceiver) {
final int callingUid = Binder.getCallingUid();
if (callingUid != ROOT_UID && callingUid != Process.SHELL_UID) {
if (resultReceiver != null) {
resultReceiver.send(-1, null);
}
throw new SecurityException("Shell commands are only callable by root or shell");
}
(new ActivityManagerShellCommand(this, false)).exec(
this, in, out, err, args, callback, resultReceiver);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment