Loading logd/CommandListener.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <netinet/in.h> #include <string.h> #include <stdlib.h> #include <sys/prctl.h> #include <sys/socket.h> #include <sys/types.h> Loading Loading @@ -66,8 +67,13 @@ CommandListener::ClearCmd::ClearCmd(LogBuffer *buf) , mBuf(*buf) { } static void setname() { prctl(PR_SET_NAME, "logd.control"); } int CommandListener::ClearCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (!clientHasLogCredentials(cli)) { cli->sendMsg("Permission Denied"); return 0; Loading Loading @@ -96,6 +102,7 @@ CommandListener::GetBufSizeCmd::GetBufSizeCmd(LogBuffer *buf) int CommandListener::GetBufSizeCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (argc < 2) { cli->sendMsg("Missing Argument"); return 0; Loading @@ -121,6 +128,7 @@ CommandListener::SetBufSizeCmd::SetBufSizeCmd(LogBuffer *buf) int CommandListener::SetBufSizeCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (!clientHasLogCredentials(cli)) { cli->sendMsg("Permission Denied"); return 0; Loading Loading @@ -154,6 +162,7 @@ CommandListener::GetBufSizeUsedCmd::GetBufSizeUsedCmd(LogBuffer *buf) int CommandListener::GetBufSizeUsedCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (argc < 2) { cli->sendMsg("Missing Argument"); return 0; Loading Loading @@ -197,6 +206,7 @@ static void package_string(char **strp) { int CommandListener::GetStatisticsCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); uid_t uid = cli->getUid(); gid_t gid = cli->getGid(); if (clientHasLogCredentials(cli)) { Loading Loading @@ -236,6 +246,7 @@ CommandListener::GetPruneListCmd::GetPruneListCmd(LogBuffer *buf) int CommandListener::GetPruneListCmd::runCommand(SocketClient *cli, int /*argc*/, char ** /*argv*/) { setname(); char *buf = NULL; mBuf.formatPrune(&buf); if (!buf) { Loading @@ -255,6 +266,7 @@ CommandListener::SetPruneListCmd::SetPruneListCmd(LogBuffer *buf) int CommandListener::SetPruneListCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (!clientHasLogCredentials(cli)) { cli->sendMsg("Permission Denied"); return 0; Loading logd/LogAudit.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <stdarg.h> #include <stdlib.h> #include <sys/klog.h> #include <sys/prctl.h> #include <sys/uio.h> #include "libaudit.h" Loading @@ -34,6 +35,8 @@ LogAudit::LogAudit(LogBuffer *buf, LogReader *reader, int fdDmsg) } bool LogAudit::onDataAvailable(SocketClient *cli) { prctl(PR_SET_NAME, "logd.auditd"); struct audit_message rep; if (audit_get_reply(cli->getSocket(), &rep, GET_REPLY_BLOCKING, 0) < 0) { Loading logd/LogListener.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ * limitations under the License. */ #include <sys/prctl.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> Loading @@ -31,6 +32,8 @@ LogListener::LogListener(LogBuffer *buf, LogReader *reader) { } bool LogListener::onDataAvailable(SocketClient *cli) { prctl(PR_SET_NAME, "logd.writer"); char buffer[sizeof_log_id_t + sizeof(uint16_t) + sizeof(log_time) + LOGGER_ENTRY_MAX_PAYLOAD]; struct iovec iov = { buffer, sizeof(buffer) }; Loading logd/LogReader.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <ctype.h> #include <poll.h> #include <sys/prctl.h> #include <sys/socket.h> #include <cutils/sockets.h> Loading @@ -36,6 +37,8 @@ void LogReader::notifyNewLog() { } bool LogReader::onDataAvailable(SocketClient *cli) { prctl(PR_SET_NAME, "logd.reader"); char buffer[255]; int len = read(cli->getSocket(), buffer, sizeof(buffer) - 1); Loading logd/LogTimes.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ * limitations under the License. */ #include <sys/prctl.h> #include "FlushCommand.h" #include "LogBuffer.h" #include "LogTimes.h" Loading Loading @@ -107,6 +109,8 @@ void LogTimeEntry::threadStop(void *obj) { } void *LogTimeEntry::threadStart(void *obj) { prctl(PR_SET_NAME, "logd.reader.per"); LogTimeEntry *me = reinterpret_cast<LogTimeEntry *>(obj); pthread_cleanup_push(threadStop, obj); Loading Loading
logd/CommandListener.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <netinet/in.h> #include <string.h> #include <stdlib.h> #include <sys/prctl.h> #include <sys/socket.h> #include <sys/types.h> Loading Loading @@ -66,8 +67,13 @@ CommandListener::ClearCmd::ClearCmd(LogBuffer *buf) , mBuf(*buf) { } static void setname() { prctl(PR_SET_NAME, "logd.control"); } int CommandListener::ClearCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (!clientHasLogCredentials(cli)) { cli->sendMsg("Permission Denied"); return 0; Loading Loading @@ -96,6 +102,7 @@ CommandListener::GetBufSizeCmd::GetBufSizeCmd(LogBuffer *buf) int CommandListener::GetBufSizeCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (argc < 2) { cli->sendMsg("Missing Argument"); return 0; Loading @@ -121,6 +128,7 @@ CommandListener::SetBufSizeCmd::SetBufSizeCmd(LogBuffer *buf) int CommandListener::SetBufSizeCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (!clientHasLogCredentials(cli)) { cli->sendMsg("Permission Denied"); return 0; Loading Loading @@ -154,6 +162,7 @@ CommandListener::GetBufSizeUsedCmd::GetBufSizeUsedCmd(LogBuffer *buf) int CommandListener::GetBufSizeUsedCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (argc < 2) { cli->sendMsg("Missing Argument"); return 0; Loading Loading @@ -197,6 +206,7 @@ static void package_string(char **strp) { int CommandListener::GetStatisticsCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); uid_t uid = cli->getUid(); gid_t gid = cli->getGid(); if (clientHasLogCredentials(cli)) { Loading Loading @@ -236,6 +246,7 @@ CommandListener::GetPruneListCmd::GetPruneListCmd(LogBuffer *buf) int CommandListener::GetPruneListCmd::runCommand(SocketClient *cli, int /*argc*/, char ** /*argv*/) { setname(); char *buf = NULL; mBuf.formatPrune(&buf); if (!buf) { Loading @@ -255,6 +266,7 @@ CommandListener::SetPruneListCmd::SetPruneListCmd(LogBuffer *buf) int CommandListener::SetPruneListCmd::runCommand(SocketClient *cli, int argc, char **argv) { setname(); if (!clientHasLogCredentials(cli)) { cli->sendMsg("Permission Denied"); return 0; Loading
logd/LogAudit.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <stdarg.h> #include <stdlib.h> #include <sys/klog.h> #include <sys/prctl.h> #include <sys/uio.h> #include "libaudit.h" Loading @@ -34,6 +35,8 @@ LogAudit::LogAudit(LogBuffer *buf, LogReader *reader, int fdDmsg) } bool LogAudit::onDataAvailable(SocketClient *cli) { prctl(PR_SET_NAME, "logd.auditd"); struct audit_message rep; if (audit_get_reply(cli->getSocket(), &rep, GET_REPLY_BLOCKING, 0) < 0) { Loading
logd/LogListener.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ * limitations under the License. */ #include <sys/prctl.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> Loading @@ -31,6 +32,8 @@ LogListener::LogListener(LogBuffer *buf, LogReader *reader) { } bool LogListener::onDataAvailable(SocketClient *cli) { prctl(PR_SET_NAME, "logd.writer"); char buffer[sizeof_log_id_t + sizeof(uint16_t) + sizeof(log_time) + LOGGER_ENTRY_MAX_PAYLOAD]; struct iovec iov = { buffer, sizeof(buffer) }; Loading
logd/LogReader.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <ctype.h> #include <poll.h> #include <sys/prctl.h> #include <sys/socket.h> #include <cutils/sockets.h> Loading @@ -36,6 +37,8 @@ void LogReader::notifyNewLog() { } bool LogReader::onDataAvailable(SocketClient *cli) { prctl(PR_SET_NAME, "logd.reader"); char buffer[255]; int len = read(cli->getSocket(), buffer, sizeof(buffer) - 1); Loading
logd/LogTimes.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ * limitations under the License. */ #include <sys/prctl.h> #include "FlushCommand.h" #include "LogBuffer.h" #include "LogTimes.h" Loading Loading @@ -107,6 +109,8 @@ void LogTimeEntry::threadStop(void *obj) { } void *LogTimeEntry::threadStart(void *obj) { prctl(PR_SET_NAME, "logd.reader.per"); LogTimeEntry *me = reinterpret_cast<LogTimeEntry *>(obj); pthread_cleanup_push(threadStop, obj); Loading