aboutsummaryrefslogtreecommitdiffstats
path: root/debuggerd/tombstone.c
diff options
context:
space:
mode:
authorrpcraig <rpcraig@tycho.ncsc.mil>2012-07-19 09:38:06 -0400
committerrpcraig <rpcraig@tycho.ncsc.mil>2012-07-19 09:38:06 -0400
commitf1186f3e980f5ebcc3380d8a7f746bf8a45e3531 (patch)
tree069324723c4e807abed9650e41c95753f9fdf0b1 /debuggerd/tombstone.c
parentf694ba5f7fa81f250045c107e919888661a734ae (diff)
downloadsystem_core-f1186f3e980f5ebcc3380d8a7f746bf8a45e3531.tar.gz
system_core-f1186f3e980f5ebcc3380d8a7f746bf8a45e3531.tar.bz2
system_core-f1186f3e980f5ebcc3380d8a7f746bf8a45e3531.zip
restorecon tombstone directory.
Restore the security contexts of tombstone directory when initially created. Change-Id: I25b53730991576eccb62ca57050decd584acc639 Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
Diffstat (limited to 'debuggerd/tombstone.c')
-rw-r--r--debuggerd/tombstone.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/debuggerd/tombstone.c b/debuggerd/tombstone.c
index 16b49433..27ab3fe9 100644
--- a/debuggerd/tombstone.c
+++ b/debuggerd/tombstone.c
@@ -35,6 +35,10 @@
#include <corkscrew/demangle.h>
#include <corkscrew/backtrace.h>
+#ifdef HAVE_SELINUX
+#include <selinux/android.h>
+#endif
+
#include "machine.h"
#include "tombstone.h"
#include "utility.h"
@@ -680,6 +684,13 @@ char* engrave_tombstone(pid_t pid, pid_t tid, int signal,
mkdir(TOMBSTONE_DIR, 0755);
chown(TOMBSTONE_DIR, AID_SYSTEM, AID_SYSTEM);
+#ifdef HAVE_SELINUX
+ if (selinux_android_restorecon(TOMBSTONE_DIR) == -1) {
+ *detach_failed = false;
+ return NULL;
+ }
+#endif
+
int fd;
char* path = find_and_open_tombstone(&fd);
if (!path) {