diff options
Diffstat (limited to 'logd/main.cpp')
| -rw-r--r-- | logd/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/logd/main.cpp b/logd/main.cpp index cf8cb8f59..8e75b37a0 100644 --- a/logd/main.cpp +++ b/logd/main.cpp @@ -106,7 +106,9 @@ static int drop_privs() { return -1; } - if (setgroups(0, NULL) == -1) { + gid_t groups[] = { AID_READPROC }; + + if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) == -1) { return -1; } @@ -298,7 +300,7 @@ static void readDmesg(LogAudit *al, LogKlog *kl) { } buf[--len] = '\0'; - if (kl) { + if (kl && kl->isMonotonic()) { kl->synchronize(buf.get(), len); } |
