summaryrefslogtreecommitdiffstats
path: root/cmds/dumpstate/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/dumpstate/utils.c')
-rw-r--r--cmds/dumpstate/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds/dumpstate/utils.c b/cmds/dumpstate/utils.c
index eaef3d4..5b8ed49 100644
--- a/cmds/dumpstate/utils.c
+++ b/cmds/dumpstate/utils.c
@@ -38,6 +38,8 @@
#include <cutils/sockets.h>
#include <private/android_filesystem_config.h>
+#include <selinux/android.h>
+
#include "dumpstate.h"
/* list of native processes to include in the native dumps */
@@ -402,6 +404,9 @@ const char *dump_traces() {
if (!mkdir(anr_traces_dir, 0775)) {
chown(anr_traces_dir, AID_SYSTEM, AID_SYSTEM);
chmod(anr_traces_dir, 0775);
+ if (selinux_android_restorecon(anr_traces_dir) == -1) {
+ fprintf(stderr, "restorecon failed for %s: %s\n", anr_traces_dir, strerror(errno));
+ }
} else if (errno != EEXIST) {
fprintf(stderr, "mkdir(%s): %s\n", anr_traces_dir, strerror(errno));
return NULL;