summaryrefslogtreecommitdiffstats
path: root/debuggerd/debuggerd.c
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2012-12-10 10:40:28 -0800
committerAndy McFadden <fadden@android.com>2012-12-10 10:40:28 -0800
commitb08084850dd1f3e1d0a69cca7095e4a68845f89a (patch)
treed7208e7bfe6927bfa0dfd750813deff1a1168537 /debuggerd/debuggerd.c
parent26f447f5daa745d40ba76b902c5d15d28aaa873f (diff)
downloadsystem_core-b08084850dd1f3e1d0a69cca7095e4a68845f89a.zip
system_core-b08084850dd1f3e1d0a69cca7095e4a68845f89a.tar.gz
system_core-b08084850dd1f3e1d0a69cca7095e4a68845f89a.tar.bz2
Show pid+uid in certain failures
If somebody sends debuggerd bad data, it logs a complaint but doesn't give any indication of the source. Now we show the pid and uid we get from SO_PEERCRED. Bug 7704699 Change-Id: I2738eb972932cc868ad969b60e16dd0b623212a1
Diffstat (limited to 'debuggerd/debuggerd.c')
-rw-r--r--debuggerd/debuggerd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/debuggerd/debuggerd.c b/debuggerd/debuggerd.c
index 55222c5..65ff0f6 100644
--- a/debuggerd/debuggerd.c
+++ b/debuggerd/debuggerd.c
@@ -202,18 +202,20 @@ static int read_request(int fd, debugger_request_t* out_request) {
pollfds[0].revents = 0;
status = TEMP_FAILURE_RETRY(poll(pollfds, 1, 3000));
if (status != 1) {
- LOG("timed out reading tid\n");
+ LOG("timed out reading tid (from pid=%d uid=%d)\n", cr.pid, cr.uid);
return -1;
}
debugger_msg_t msg;
status = TEMP_FAILURE_RETRY(read(fd, &msg, sizeof(msg)));
if (status < 0) {
- LOG("read failure? %s\n", strerror(errno));
+ LOG("read failure? %s (pid=%d uid=%d)\n",
+ strerror(errno), cr.pid, cr.uid);
return -1;
}
if (status != sizeof(msg)) {
- LOG("invalid crash request of size %d\n", status);
+ LOG("invalid crash request of size %d (from pid=%d uid=%d)\n",
+ status, cr.pid, cr.uid);
return -1;
}
@@ -245,7 +247,7 @@ static int read_request(int fd, debugger_request_t* out_request) {
return -1;
}
} else {
- /* No one else is not allowed to dump arbitrary processes. */
+ /* No one else is allowed to dump arbitrary processes. */
return -1;
}
return 0;