summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2012-10-16 17:51:14 -0700
committerKenny Root <kroot@google.com>2012-10-16 17:51:14 -0700
commit20f5daa8653eb2d81af8c161a2084e3b53ec3914 (patch)
tree716474f1851ccb7de43bc9806bc1bcae2e264476 /toolbox
parentd94301799518a69f2b2b5a2b20bf9d4403658d7e (diff)
parent44f4f8a4d2bef6e9fc37cd50076295102b38828a (diff)
downloadsystem_core-20f5daa8653eb2d81af8c161a2084e3b53ec3914.zip
system_core-20f5daa8653eb2d81af8c161a2084e3b53ec3914.tar.gz
system_core-20f5daa8653eb2d81af8c161a2084e3b53ec3914.tar.bz2
resolved conflicts for merge of 44f4f8a4 to jb-mr1-dev-plus-aosp
Change-Id: I66988d8e87a8110ca9ab3da19870b80bbaf06eba
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/Android.mk23
-rw-r--r--toolbox/id.c7
-rw-r--r--toolbox/ls.c6
3 files changed, 6 insertions, 30 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index 086ba0d..dbbce06 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -57,11 +57,7 @@ TOOLS := \
touch \
lsof \
du \
- md5
-
-ifeq ($(HAVE_SELINUX),true)
-
-TOOLS += \
+ md5 \
getenforce \
setenforce \
chcon \
@@ -71,9 +67,6 @@ TOOLS += \
setsebool \
load_policy
-endif
-
-
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
TOOLS += r
endif
@@ -90,17 +83,13 @@ LOCAL_SRC_FILES := \
cp/cp.c cp/utils.c \
grep/grep.c grep/fastgrep.c grep/file.c grep/queue.c grep/util.c
-LOCAL_SHARED_LIBRARIES := libcutils libc libusbhost
-
LOCAL_C_INCLUDES := bionic/libc/bionic
-ifeq ($(HAVE_SELINUX),true)
-
-LOCAL_CFLAGS += -DHAVE_SELINUX
-LOCAL_SHARED_LIBRARIES += libselinux
-LOCAL_C_INCLUDES += external/libselinux/include
-
-endif
+LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+ libc \
+ libusbhost \
+ libselinux
LOCAL_MODULE := toolbox
diff --git a/toolbox/id.c b/toolbox/id.c
index bc79288..8ec79c1 100644
--- a/toolbox/id.c
+++ b/toolbox/id.c
@@ -4,10 +4,7 @@
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
-
-#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
-#endif
static void print_uid(uid_t uid)
{
@@ -34,9 +31,7 @@ int id_main(int argc, char **argv)
{
gid_t list[64];
int n, max;
-#ifdef HAVE_SELINUX
char *secctx;
-#endif
max = getgroups(64, list);
if (max < 0) max = 0;
@@ -53,12 +48,10 @@ int id_main(int argc, char **argv)
print_gid(list[n]);
}
}
-#ifdef HAVE_SELINUX
if (getcon(&secctx) == 0) {
printf(" context=%s", secctx);
free(secctx);
}
-#endif
printf("\n");
return 0;
}
diff --git a/toolbox/ls.c b/toolbox/ls.c
index b7ba1b7..e530521 100644
--- a/toolbox/ls.c
+++ b/toolbox/ls.c
@@ -5,9 +5,7 @@
#include <dirent.h>
#include <errno.h>
-#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
-#endif
#include <sys/stat.h>
#include <unistd.h>
@@ -260,11 +258,7 @@ static int listfile_maclabel(const char *path, int flags)
return -1;
}
-#ifdef HAVE_SELINUX
lgetfilecon(path, &maclabel);
-#else
- maclabel = strdup("-");
-#endif
if (!maclabel) {
return -1;
}