From 39a6bd33ce3278d590da0f35b707fb8c5bedae84 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 5 Dec 2017 05:32:15 +0800 Subject: [PATCH] Fix critical bug --- core/jni/magiskboot/ramdisk.c | 2 +- core/jni/utils/file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/jni/magiskboot/ramdisk.c b/core/jni/magiskboot/ramdisk.c index 4d0fd4193..5dcfa4b34 100644 --- a/core/jni/magiskboot/ramdisk.c +++ b/core/jni/magiskboot/ramdisk.c @@ -80,7 +80,7 @@ int cpio_commands(const char *command, int argc, char *argv[]) { parse_cpio(&v, incpio); if (strcmp(command, "test") == 0) { - return cpio_test(&v); + exit(cpio_test(&v)); } else if (strcmp(command, "restore") == 0) { ret = cpio_restore(&v); } else if (strcmp(command, "stocksha1") == 0) { diff --git a/core/jni/utils/file.c b/core/jni/utils/file.c index f6027d915..e33d1c4e6 100644 --- a/core/jni/utils/file.c +++ b/core/jni/utils/file.c @@ -260,7 +260,7 @@ int getattrat(int dirfd, const char *pathname, struct file_attr *a) { } int fgetattr(int fd, struct file_attr *a) { -#ifndef NO_SELINUX +#ifdef SELINUX char path[PATH_MAX]; fd_getpath(fd, path, sizeof(path)); return getattr(path, a);