avs_mtk_voice/meta/meta-mediatek-aud/recipes-devtools/android-tools/android-tools-adbd/disable-selinux-support.patch

138 lines
3.6 KiB
Diff
Executable File

diff --git a/extras/ext4_utils/make_ext4fs.c b/extras/ext4_utils/make_ext4fs.c
index b2d1426..94e92d6 100644
--- a/extras/ext4_utils/make_ext4fs.c
+++ b/extras/ext4_utils/make_ext4fs.c
@@ -59,9 +59,11 @@
#else
+#if 0
#include <selinux/selinux.h>
#include <selinux/label.h>
#include <selinux/android.h>
+#endif
#define O_BINARY 0
@@ -178,6 +180,7 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
error("can't set android permissions - built without android support");
#endif
}
+#if 0
#ifndef USE_MINGW
if (sehnd) {
if (selabel_lookup(sehnd, &dentries[i].secon, dentries[i].path, stat.st_mode) < 0) {
@@ -188,6 +191,7 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
printf("Labeling %s as %s\n", dentries[i].path, dentries[i].secon);
}
#endif
+#endif
if (S_ISREG(stat.st_mode)) {
dentries[i].file_type = EXT4_FT_REG_FILE;
@@ -229,10 +233,12 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
dentries[0].file_type = EXT4_FT_DIR;
dentries[0].uid = 0;
dentries[0].gid = 0;
+#if 0
if (sehnd) {
if (selabel_lookup(sehnd, &dentries[0].secon, dentries[0].path, dentries[0].mode) < 0)
error("cannot lookup security context for %s", dentries[0].path);
}
+#endif
entries++;
dirs++;
}
@@ -270,9 +276,11 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
dentries[i].mtime);
if (ret)
error("failed to set permissions on %s\n", dentries[i].path);
+#if 0
ret = inode_set_selinux(entry_inode, dentries[i].secon);
if (ret)
error("failed to set SELinux context on %s\n", dentries[i].path);
+#endif
free(dentries[i].path);
free(dentries[i].full_path);
@@ -562,6 +570,7 @@ int make_ext4fs_internal(int fd, const char *_directory,
root_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
inode_set_permissions(root_inode_num, root_mode, 0, 0, 0);
+#if 0
#ifndef USE_MINGW
if (sehnd) {
char *secontext = NULL;
@@ -578,6 +587,7 @@ int make_ext4fs_internal(int fd, const char *_directory,
freecon(secontext);
}
#endif
+#endif
ext4_update_free();
diff --git a/extras/ext4_utils/make_ext4fs_main.c b/extras/ext4_utils/make_ext4fs_main.c
index b6c740d..ce31764 100644
--- a/extras/ext4_utils/make_ext4fs_main.c
+++ b/extras/ext4_utils/make_ext4fs_main.c
@@ -29,6 +29,7 @@
#include <private/android_filesystem_config.h>
#endif
+#if 0
#ifndef USE_MINGW
#include <selinux/selinux.h>
#include <selinux/label.h>
@@ -36,6 +37,7 @@
#else
struct selabel_handle;
#endif
+#endif
#include "make_ext4fs.h"
#include "ext4_utils.h"
@@ -72,9 +74,11 @@ int main(int argc, char **argv)
int exitcode;
int verbose = 0;
struct selabel_handle *sehnd = NULL;
+#if 0
#ifndef USE_MINGW
struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } };
#endif
+#endif
while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:S:fwzJsctv")) != -1) {
switch (opt) {
@@ -131,6 +135,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Warning: -t (initialize inode tables) is deprecated\n");
break;
case 'S':
+#if 0
#ifndef USE_MINGW
seopts[0].value = optarg;
sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1);
@@ -139,6 +144,7 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
#endif
+#endif
break;
case 'v':
verbose = 1;
@@ -149,6 +155,7 @@ int main(int argc, char **argv)
}
}
+#if 0
#if !defined(HOST)
// Use only if -S option not requested
if (!sehnd && mountpoint) {
@@ -160,6 +167,7 @@ int main(int argc, char **argv)
}
}
#endif
+#endif
if (wipe && sparse) {
fprintf(stderr, "Cannot specifiy both wipe and sparse\n");