From 7bc8023857ebe8ce91b659e6dce3004b38f91e8b Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Fri, 11 Dec 2015 12:32:53 -0800 Subject: [PATCH] liblog: logprint security ANDROID_LOG_WARN Bug: 26029733 Change-Id: I4f0cffc0a45819fb48807bf06ce336316276369d --- liblog/logprint.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/liblog/logprint.c b/liblog/logprint.c index 746eb8aa2..bd36cddb8 100644 --- a/liblog/logprint.c +++ b/liblog/logprint.c @@ -750,12 +750,17 @@ int android_log_processBinaryLogBuffer(struct logger_entry *buf, entry->tid = buf->tid; /* - * Pull the tag out. + * Pull the tag out, fill in some additional details based on incoming + * buffer version (v3 adds lid, v4 adds uid). */ eventData = (const unsigned char*) buf->msg; struct logger_entry_v2 *buf2 = (struct logger_entry_v2 *)buf; if (buf2->hdr_size) { eventData = ((unsigned char *)buf2) + buf2->hdr_size; + if ((buf2->hdr_size >= sizeof(struct logger_entry_v3)) && + (((struct logger_entry_v3 *)buf)->lid == LOG_ID_SECURITY)) { + entry->priority = ANDROID_LOG_WARN; + } if (buf2->hdr_size >= sizeof(struct logger_entry_v4)) { entry->uid = ((struct logger_entry_v4 *)buf)->uid; }