summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-04-03 11:55:26 -0500
committerMark Salyzyn2014-04-07 12:51:00 -0500
commite9bebd0eb1845f0c6009ce2edc5aeb47bf89e397 (patch)
treed59da52bf2bf374e3a7dce6933227f6c55fa239e /logd/main.cpp
parent29d238d2a8e12c131a4cfbccb912e525cca6b10d (diff)
downloadplatform-system-core-e9bebd0eb1845f0c6009ce2edc5aeb47bf89e397.tar.gz
platform-system-core-e9bebd0eb1845f0c6009ce2edc5aeb47bf89e397.tar.xz
platform-system-core-e9bebd0eb1845f0c6009ce2edc5aeb47bf89e397.zip
logd: auditd: add logd.auditd.dmesg property
Change-Id: If4a579c2221eec99cf3f6acf59ead8c2d5230517
Diffstat (limited to 'logd/main.cpp')
-rw-r--r--logd/main.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/logd/main.cpp b/logd/main.cpp
index 83ec6c0aa..7346e2fa9 100644
--- a/logd/main.cpp
+++ b/logd/main.cpp
@@ -84,6 +84,13 @@ static int drop_privs() {
84// space logger. Additional transitory per-client threads are created 84// space logger. Additional transitory per-client threads are created
85// for each reader once they register. 85// for each reader once they register.
86int main() { 86int main() {
87 int fdDmesg = -1;
88 char dmesg[PROPERTY_VALUE_MAX];
89 property_get("logd.auditd.dmesg", dmesg, "1");
90 if (atol(dmesg)) {
91 fdDmesg = open("/dev/kmsg", O_WRONLY);
92 }
93
87 if (drop_privs() != 0) { 94 if (drop_privs() != 0) {
88 return -1; 95 return -1;
89 } 96 }
@@ -136,9 +143,10 @@ int main() {
136 // and LogReader is notified to send updates to connected clients. 143 // and LogReader is notified to send updates to connected clients.
137 144
138 // failure is an option ... messages are in dmesg (required by standard) 145 // failure is an option ... messages are in dmesg (required by standard)
139 LogAudit *al = new LogAudit(logBuf, reader); 146 LogAudit *al = new LogAudit(logBuf, reader, fdDmesg);
140 if (al->startListener()) { 147 if (al->startListener()) {
141 delete al; 148 delete al;
149 close(fdDmesg);
142 } 150 }
143 151
144 pause(); 152 pause();