Merge "logd: security buffer only AID_SYSTEM reader"
am: 69ce7c5483
* commit '69ce7c5483709d2c005ae2c77f89b3c3835e8ba5':
logd: security buffer only AID_SYSTEM reader
This commit is contained in:
commit
c3dff7a5dc
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue