summaryrefslogtreecommitdiffstats
path: root/logd/LogUtils.h
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-12-04 10:59:45 -0800
committerMark Salyzyn <salyzyn@google.com>2015-12-08 16:46:29 -0800
commit083b037c0740ca00f72429e4457bfdd4b4d4dfa7 (patch)
tree6748f9f8bcaebd495df77604dfeba68e0b65b5be /logd/LogUtils.h
parentcb3e6ef15459388fc8fee2b4a3157ff0eac0714a (diff)
downloadsystem_core-083b037c0740ca00f72429e4457bfdd4b4d4dfa7.tar.gz
system_core-083b037c0740ca00f72429e4457bfdd4b4d4dfa7.tar.bz2
system_core-083b037c0740ca00f72429e4457bfdd4b4d4dfa7.zip
logd: liblog: logcat: Add LOG_ID_SECURITY
- Largish commit, buffer and access controls done together - Add LOG_ID_SECURITY binary content log - Add "default" meta buffer - allow LOG_ID_SECURITY only from AID_SYSTEM and AID_ROOT UID & GID - Use __android_log_security() to gate logging - Add __android_log_security_bwrite() native access to security logging. - Add liblog.__security_buffer end-to-end gTest Bug: 26029733 Change-Id: Ibcf5b4660c17c1aa6902c0d93f8ffd29c93d9a93
Diffstat (limited to 'logd/LogUtils.h')
-rw-r--r--logd/LogUtils.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/logd/LogUtils.h b/logd/LogUtils.h
index 533eb1c5f..b591f2892 100644
--- a/logd/LogUtils.h
+++ b/logd/LogUtils.h
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <log/log.h>
+#include <sysutils/SocketClient.h>
// Hijack this header as a common include file used by most all sources
// to report some utilities defined here and there.
@@ -38,8 +39,12 @@ const char *tagToName(uint32_t tag);
}
+// Furnished in LogCommand.cpp
+bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid);
+bool clientHasLogCredentials(SocketClient *cli);
+
static inline bool worstUidEnabledForLogid(log_id_t id) {
- return (id != LOG_ID_CRASH) && (id != LOG_ID_KERNEL) && (id != LOG_ID_EVENTS);
+ return (id == LOG_ID_MAIN) || (id == LOG_ID_SYSTEM) || (id == LOG_ID_RADIO);
}
template <int (*cmp)(const char *l, const char *r, const size_t s)>