From d7674c2be5e6024b5a4d66a30472744f9998c7cc Mon Sep 17 00:00:00 2001 From: Stanislav Zholnin Date: Mon, 17 Feb 2020 17:48:12 +0000 Subject: [PATCH] Fix bug in StatsService which prevents any shell command from execution. Bug: 149691126 Test: adb shell cmd stats Change-Id: I71befdd02e61de0f39cdff9694d4ab07abb1799c --- cmds/statsd/src/StatsService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp index 7087c68ecc9fd..7ab6c7111b3ed 100644 --- a/cmds/statsd/src/StatsService.cpp +++ b/cmds/statsd/src/StatsService.cpp @@ -280,7 +280,7 @@ void StatsService::dumpIncidentSection(int out) { status_t StatsService::handleShellCommand(int in, int out, int err, const char** argv, uint32_t argc) { uid_t uid = AIBinder_getCallingUid(); - if (uid != AID_ROOT || uid != AID_SHELL) { + if (uid != AID_ROOT && uid != AID_SHELL) { return PERMISSION_DENIED; }