summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot2017-03-06 16:26:16 -0600
committerGerrit Code Review2017-03-06 16:26:17 -0600
commit56e89ade33c649412999d2663acc2f12ca9873a8 (patch)
treeb16b180eac508047d38ab0d1ede638e69e4ca18b
parent514e0aa2e245c26aeb5520436125505c230c649f (diff)
parent55f79a5953e81c6b7ae56081e3c2fd2711a47dbc (diff)
downloadplatform-system-core-56e89ade33c649412999d2663acc2f12ca9873a8.tar.gz
platform-system-core-56e89ade33c649412999d2663acc2f12ca9873a8.tar.xz
platform-system-core-56e89ade33c649412999d2663acc2f12ca9873a8.zip
Merge changes Ib69a206f,If57cc175
* changes: tombstoned: turn off signal handlers. tombstoned: create tombstones with 0640 permissions.
-rw-r--r--debuggerd/tombstoned/tombstoned.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/debuggerd/tombstoned/tombstoned.cpp b/debuggerd/tombstoned/tombstoned.cpp
index 8705ecea5..67545088d 100644
--- a/debuggerd/tombstoned/tombstoned.cpp
+++ b/debuggerd/tombstoned/tombstoned.cpp
@@ -34,6 +34,7 @@
34#include <android-base/unique_fd.h> 34#include <android-base/unique_fd.h>
35#include <cutils/sockets.h> 35#include <cutils/sockets.h>
36 36
37#include "debuggerd/handler.h"
37#include "debuggerd/protocol.h" 38#include "debuggerd/protocol.h"
38#include "debuggerd/util.h" 39#include "debuggerd/util.h"
39 40
@@ -116,7 +117,7 @@ static unique_fd get_tombstone_fd() {
116 } 117 }
117 118
118 result.reset( 119 result.reset(
119 openat(tombstone_directory_fd, buf, O_CREAT | O_EXCL | O_WRONLY | O_APPEND | O_CLOEXEC, 0700)); 120 openat(tombstone_directory_fd, buf, O_CREAT | O_EXCL | O_WRONLY | O_APPEND | O_CLOEXEC, 0640));
120 if (result == -1) { 121 if (result == -1) {
121 PLOG(FATAL) << "failed to create tombstone at " << kTombstoneDirectory << buf; 122 PLOG(FATAL) << "failed to create tombstone at " << kTombstoneDirectory << buf;
122 } 123 }
@@ -254,6 +255,16 @@ fail:
254} 255}
255 256
256int main(int, char* []) { 257int main(int, char* []) {
258 umask(0137);
259
260 // Don't try to connect to ourselves if we crash.
261 struct sigaction action = {};
262 action.sa_handler = [](int signal) {
263 LOG(ERROR) << "received fatal signal " << signal;
264 _exit(1);
265 };
266 debuggerd_register_handlers(&action);
267
257 tombstone_directory_fd = open(kTombstoneDirectory, O_DIRECTORY | O_RDONLY | O_CLOEXEC); 268 tombstone_directory_fd = open(kTombstoneDirectory, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
258 if (tombstone_directory_fd == -1) { 269 if (tombstone_directory_fd == -1) {
259 PLOG(FATAL) << "failed to open tombstone directory"; 270 PLOG(FATAL) << "failed to open tombstone directory";