diff options
author | Mark Salyzyn <salyzyn@google.com> | 2016-01-26 20:41:51 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-01-26 20:41:51 +0000 |
commit | 69ce7c5483709d2c005ae2c77f89b3c3835e8ba5 (patch) | |
tree | 7e220f1bcc24f1be8d09c855bbf1f6c3d67a7148 /logd | |
parent | 15035388694f92d84576aeeb0837e0d928250a59 (diff) | |
parent | 756332e88b98018d82f225c54734be3d76102bfc (diff) | |
download | core-69ce7c5483709d2c005ae2c77f89b3c3835e8ba5.tar.gz core-69ce7c5483709d2c005ae2c77f89b3c3835e8ba5.tar.bz2 core-69ce7c5483709d2c005ae2c77f89b3c3835e8ba5.zip |
Merge "logd: security buffer only AID_SYSTEM reader"
Diffstat (limited to 'logd')
-rw-r--r-- | logd/LogListener.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp index 846dd7c41..cc6df8051 100644 --- a/logd/LogListener.cpp +++ b/logd/LogListener.cpp @@ -36,6 +36,18 @@ LogListener::LogListener(LogBuffer *buf, LogReader *reader) : reader(reader) { } +static bool clientHasSecurityCredentials(uid_t uid, gid_t gid, pid_t /* pid */) { + if (uid == AID_SYSTEM) { + return true; + } + + if (gid == AID_SYSTEM) { + return true; + } + + return false; +} + bool LogListener::onDataAvailable(SocketClient *cli) { static bool name_set; if (!name_set) { @@ -98,7 +110,7 @@ bool LogListener::onDataAvailable(SocketClient *cli) { if ((header->id == LOG_ID_SECURITY) && (!__android_log_security() || - !clientHasLogCredentials(cred->uid, cred->gid, cred->pid))) { + !clientHasSecurityCredentials(cred->uid, cred->gid, cred->pid))) { return false; } |