Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 211f9fb1 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Android Git Automerger
Browse files

am 21c2c849: am b9994d22: am 8261d271: Merge "restorecon tombstone directory."

* commit '21c2c849':
  restorecon tombstone directory.
parents 79737802 21c2c849
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,12 @@ endif # ARCH_ARM_HAVE_VFP_D32

LOCAL_SHARED_LIBRARIES := libcutils libc libcorkscrew

ifeq ($(HAVE_SELINUX),true)
LOCAL_SHARED_LIBRARIES += libselinux
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_CFLAGS += -DHAVE_SELINUX
endif

include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
+11 −0
Original line number Diff line number Diff line
@@ -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) {