summaryrefslogtreecommitdiffstats
path: root/minzip
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2012-10-17 01:33:39 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2012-10-17 01:33:40 +0200
commit78afed1c15989d4aa7e66094afa81cd3a6d22674 (patch)
tree0462d8372a28cd14dc5a2389b25500687e7950c9 /minzip
parentMerge "Fixing trivial warnings for libminui" (diff)
parentRemove HAVE_SELINUX guards (diff)
downloadandroid_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.tar
android_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.tar.gz
android_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.tar.bz2
android_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.tar.lz
android_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.tar.xz
android_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.tar.zst
android_bootable_recovery-78afed1c15989d4aa7e66094afa81cd3a6d22674.zip
Diffstat (limited to 'minzip')
-rw-r--r--minzip/Android.mk8
-rw-r--r--minzip/DirUtil.c5
-rw-r--r--minzip/DirUtil.h4
-rw-r--r--minzip/Zip.c4
-rw-r--r--minzip/Zip.h4
5 files changed, 2 insertions, 23 deletions
diff --git a/minzip/Android.mk b/minzip/Android.mk
index 6c1d0969c..045f35570 100644
--- a/minzip/Android.mk
+++ b/minzip/Android.mk
@@ -8,15 +8,11 @@ LOCAL_SRC_FILES := \
Inlines.c \
Zip.c
-LOCAL_C_INCLUDES += \
+LOCAL_C_INCLUDES := \
external/zlib \
external/safe-iop/include
-ifeq ($(HAVE_SELINUX),true)
-LOCAL_C_INCLUDES += external/libselinux/include
-LOCAL_STATIC_LIBRARIES += libselinux
-LOCAL_CFLAGS += -DHAVE_SELINUX
-endif
+LOCAL_STATIC_LIBRARIES := libselinux
LOCAL_MODULE := libminzip
diff --git a/minzip/DirUtil.c b/minzip/DirUtil.c
index 0d49b5780..8dd5da1da 100644
--- a/minzip/DirUtil.c
+++ b/minzip/DirUtil.c
@@ -145,24 +145,19 @@ dirCreateHierarchy(const char *path, int mode,
} else if (ds == DMISSING) {
int err;
-#ifdef HAVE_SELINUX
char *secontext = NULL;
if (sehnd) {
selabel_lookup(sehnd, &secontext, cpath, mode);
setfscreatecon(secontext);
}
-#endif
err = mkdir(cpath, mode);
-#ifdef HAVE_SELINUX
-
if (secontext) {
freecon(secontext);
setfscreatecon(NULL);
}
-#endif
if (err != 0) {
free(cpath);
diff --git a/minzip/DirUtil.h b/minzip/DirUtil.h
index f8be64026..a5cfa761b 100644
--- a/minzip/DirUtil.h
+++ b/minzip/DirUtil.h
@@ -24,12 +24,8 @@
extern "C" {
#endif
-#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
#include <selinux/label.h>
-#else
-struct selabel_handle;
-#endif
/* Like "mkdir -p", try to guarantee that all directories
* specified in path are present, creating as many directories
diff --git a/minzip/Zip.c b/minzip/Zip.c
index 54d5d55a3..c87f038c5 100644
--- a/minzip/Zip.c
+++ b/minzip/Zip.c
@@ -1115,23 +1115,19 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
* Open the target for writing.
*/
-#ifdef HAVE_SELINUX
char *secontext = NULL;
if (sehnd) {
selabel_lookup(sehnd, &secontext, targetFile, UNZIP_FILEMODE);
setfscreatecon(secontext);
}
-#endif
int fd = creat(targetFile, UNZIP_FILEMODE);
-#ifdef HAVE_SELINUX
if (secontext) {
freecon(secontext);
setfscreatecon(NULL);
}
-#endif
if (fd < 0) {
LOGE("Can't create target file \"%s\": %s\n",
diff --git a/minzip/Zip.h b/minzip/Zip.h
index 4bb9ef6a4..c94282827 100644
--- a/minzip/Zip.h
+++ b/minzip/Zip.h
@@ -18,12 +18,8 @@
extern "C" {
#endif
-#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
#include <selinux/label.h>
-#else
-struct selabel_handle;
-#endif
/*
* One entry in the Zip archive. Treat this as opaque -- use accessors below.