busybox: squashed commit of merging cm-12.1
With fixes to LOCAL_C_INCLUDES for libsepol in M and fixed
some missing includes to enable building for 64 bit devices
Conflicts:
Android.mk
android/libc/arch-x86/syscalls/swapoff.S
android/libc/arch-x86/syscalls/swapon.S
android/libc/arch-x86/syscalls/sysinfo.S
android/librpc/pmap_rmt.c
android/reboot.c
include-full/copy-current.sh
include-minimal/copy-current.sh
include/platform.h
networking/interface.c
networking/nslookup.c
Change-Id: If6092fa87f3d21190db1af4f70daa150eb462660
diff --git a/android/selinux/stubs.c b/android/selinux/stubs.c
new file mode 100644
index 0000000..c01bc57
--- /dev/null
+++ b/android/selinux/stubs.c
@@ -0,0 +1,39 @@
+#include <libbb.h>
+#include <selinux/selinux.h>
+
+/* create a new context with user name (may be unsafe) */
+int get_default_context(const char* user,
+ const char* fromcon UNUSED_PARAM,
+ char ** newcon)
+{
+ char fmt[] = "u:r:%s:s0\0";
+ int len = strlen(user) + strlen(fmt);
+
+ *newcon = malloc(len);
+ if (!(*newcon))
+ return -1;
+ snprintf(*newcon, len, fmt, user);
+ return 0;
+}
+
+/* Compute a relabeling decision and set *newcon to refer to it.
+ Caller must free via freecon.
+ Stub not implemented in bionic, but declared in selinux.h */
+int security_compute_relabel(const char *scon UNUSED_PARAM,
+ const char *tcon,
+ security_class_t tclass UNUSED_PARAM,
+ char ** newcon)
+{
+ if (tcon)
+ *newcon = strdup(tcon);
+ if (!(*newcon))
+ return -1;
+ return 0;
+}
+
+/* Check a permission in the passwd class.
+ Return 0 if granted or -1 otherwise. */
+int selinux_check_passwd_access(access_vector_t requested UNUSED_PARAM)
+{
+ return 0;
+}