diff options
author | Kenny Root <kroot@google.com> | 2012-10-16 16:33:47 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-10-16 16:33:48 -0700 |
commit | f310f6c5725f9f9985ee30e744a2b65fed9d572e (patch) | |
tree | ce9adaca8d2b8e153f3ad5d8cb85ae9746fe73ac | |
parent | b67683f6c0c75536c991cac797b0c1dbcf9168e0 (diff) | |
parent | 723f1c75295ce812dc062a537856cd5a54277895 (diff) | |
download | extras-f310f6c5725f9f9985ee30e744a2b65fed9d572e.tar.gz |
Merge "Remove HAVE_SELINUX guards"
-rw-r--r-- | ext4_utils/Android.mk | 53 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs.c | 7 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs.h | 2 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs_main.c | 6 |
4 files changed, 23 insertions, 45 deletions
diff --git a/ext4_utils/Android.mk b/ext4_utils/Android.mk index 99145a4a..f9b571e2 100644 --- a/ext4_utils/Android.mk +++ b/ext4_utils/Android.mk @@ -21,13 +21,12 @@ libext4_utils_src_files := \ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libext4_utils_src_files) LOCAL_MODULE := libext4_utils_host -LOCAL_C_INCLUDES += external/zlib -LOCAL_STATIC_LIBRARIES += libsparse_host -ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include +LOCAL_STATIC_LIBRARIES := \ + libsparse_host \ + libz +ifneq ($(HOST_OS),windows) LOCAL_STATIC_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX +endif include $(BUILD_HOST_STATIC_LIBRARY) @@ -41,11 +40,7 @@ LOCAL_STATIC_LIBRARIES += \ ifeq ($(HOST_OS),windows) LOCAL_LDLIBS += -lws2_32 else - ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include - LOCAL_STATIC_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX - endif # HAVE_SELINUX + LOCAL_STATIC_LIBRARIES += libselinux endif include $(BUILD_HOST_EXECUTABLE) @@ -59,41 +54,29 @@ ifneq ($(HOST_OS),windows) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libext4_utils_src_files) LOCAL_MODULE := libext4_utils -LOCAL_C_INCLUDES += external/zlib LOCAL_SHARED_LIBRARIES := \ + libselinux \ libsparse \ libz -ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include - LOCAL_SHARED_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libext4_utils_src_files) LOCAL_MODULE := libext4_utils_static -LOCAL_C_INCLUDES += external/zlib LOCAL_STATIC_LIBRARIES += \ + libselinux \ libsparse_static -ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include - LOCAL_STATIC_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_SRC_FILES := make_ext4fs_main.c LOCAL_MODULE := make_ext4fs -LOCAL_SHARED_LIBRARIES += libext4_utils libz -ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include - LOCAL_SHARED_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX +LOCAL_SHARED_LIBRARIES := \ + libext4_utils \ + libselinux \ + libz include $(BUILD_EXECUTABLE) @@ -102,13 +85,9 @@ LOCAL_SRC_FILES := ext2simg.c LOCAL_MODULE := ext2simg LOCAL_SHARED_LIBRARIES += \ libext4_utils \ + libselinux \ libsparse \ libz -ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include - LOCAL_SHARED_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX include $(BUILD_EXECUTABLE) @@ -117,13 +96,9 @@ LOCAL_SRC_FILES := ext2simg.c LOCAL_MODULE := ext2simg LOCAL_STATIC_LIBRARIES += \ libext4_utils_host \ + libselinux \ libsparse_host \ libz -ifeq ($(HAVE_SELINUX), true) - LOCAL_C_INCLUDES += external/libselinux/include - LOCAL_STATIC_LIBRARIES += libselinux - LOCAL_CFLAGS += -DHAVE_SELINUX -endif # HAVE_SELINUX include $(BUILD_HOST_EXECUTABLE) diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c index 662da6d9..ca81398b 100644 --- a/ext4_utils/make_ext4fs.c +++ b/ext4_utils/make_ext4fs.c @@ -157,15 +157,18 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path error("can't set android permissions - built without android support"); #endif } -#ifdef HAVE_SELINUX +#ifndef USE_MINGW if (sehnd) { char *sepath = NULL; asprintf(&sepath, "/%s", dentries[i].path); if (selabel_lookup(sehnd, &dentries[i].secon, sepath, stat.st_mode) < 0) { error("cannot lookup security context for %s", sepath); } +#if 0 + // TODO make this a debug flag if (dentries[i].secon) printf("Labeling %s as %s\n", sepath, dentries[i].secon); +#endif free(sepath); } #endif @@ -428,7 +431,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); -#ifdef HAVE_SELINUX +#ifndef USE_MINGW if (sehnd) { char *sepath = NULL; char *secontext = NULL; diff --git a/ext4_utils/make_ext4fs.h b/ext4_utils/make_ext4fs.h index bfc008a2..577157ac 100644 --- a/ext4_utils/make_ext4fs.h +++ b/ext4_utils/make_ext4fs.h @@ -24,7 +24,7 @@ extern "C" { #endif -#ifdef HAVE_SELINUX +#ifndef USE_MINGW #include <selinux/selinux.h> #include <selinux/label.h> #else diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c index f7beeb5f..c54618db 100644 --- a/ext4_utils/make_ext4fs_main.c +++ b/ext4_utils/make_ext4fs_main.c @@ -62,7 +62,7 @@ int main(int argc, char **argv) int fd; int exitcode; struct selabel_handle *sehnd = NULL; -#ifdef HAVE_SELINUX +#ifndef USE_MINGW struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } }; #endif @@ -121,7 +121,7 @@ int main(int argc, char **argv) init_itabs = 1; break; case 'S': -#ifdef HAVE_SELINUX +#ifndef USE_MINGW seopts[0].value = optarg; sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1); if (!sehnd) { @@ -129,7 +129,7 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } #endif - break; + break; default: /* '?' */ usage(argv[0]); exit(EXIT_FAILURE); |