aboutsummaryrefslogtreecommitdiffstats
path: root/libselinux/src
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2017-04-05 15:12:21 -0700
committerNick Kralevich <nnk@google.com>2017-04-05 15:14:55 -0700
commit5bb95be0683377e546d3f687265763e1052ed255 (patch)
tree39a8a905e1c7e3c8d6d5df21cef1ab217118f33b /libselinux/src
parent167f6864eda7489e892bd583e994e0881a4f4b4d (diff)
parent92f22e193a7e78702178bf9960f03167ba3ea1df (diff)
downloadandroid_external_selinux-5bb95be0683377e546d3f687265763e1052ed255.tar.gz
android_external_selinux-5bb95be0683377e546d3f687265763e1052ed255.tar.bz2
android_external_selinux-5bb95be0683377e546d3f687265763e1052ed255.zip
Merge remote-tracking branch 'aosp/upstream-master' into mymerge
Please see go/android-upstream for merging a remote tracking branch into Android. Automatic replication is already enabled for external/selinux. This just merges those changes into Android's master branch. The following patches are included in this merge: 7fe9a7be libsepol/cil: use __cil_ordered_lists_destroy() to free unordered_classorder_lists 602385d7 libsepol/cil: free the first operand if the second one is invalid 9feaf038 libsepol/cil: do not leak left-hand side of an invalid constraint 95e5c103 libsepol/cil: free bitmaps in cil_level_equals() a2d40aae libsepol/cil: Move initialization of bitmap in __cil_permx_to_bitmap() 1cd3e1a4 libselinux, libsemanage: make PYPREFIX computation more robust ed51e23f sepolgen: strip non-printable characters when parsing audit messages 32288896 semodule_package: do not leak memory when using -u or -s ddaf0afe libsepol/cil: do not dereference args before checking it was not null 4176a292 libsemanage: never call memcpy with a NULL value ccfbd9aa libsemanage/tests: include libsepol headers from $DESTDIR 6305bfbc mcstrans: do not dereference color_str if it is NULL ded385d3 libselinux: initialize temp value in SWIG wrapper to prevent freeing garbage 43b24f01 libsepol: Define cgroup_seclabel policy capability e720859f restorecond: add noreturn attribute to exitApp() ef61dd7d checkpolicy: add noreturn attribute to usage() 840a7c91 secilc: add noreturn attribute to usage() 2f8926f7 mcstrans: add noreturn attribute to usage() 28a6a560 semodule-utils: add noreturn attribute to usage() cd20f9c2 policycoreutils: add noreturn attribute to usage() 718bc4bc python/sepolicy: fix obtaining domain name in HTMLManPages fba9d010 Python 3.6 invalid escape sequence deprecation fixes 317743bb python/semanage: fix export of fcontext socket entries 08648145 libsepol/cil: make reporting conflicting type transitions work 6707526f libsepol/cil: avoid freeing uninitialized values 9087bb9c checkpolicy: dereference rangehead after checking it was not NULL dd11ab6f checkpolicy: Fix minor memory leak in checkpolicy c408c70b libsepol/cil: Allow hexadecimal numbers in Xen context rules 526d0dad libsepol: Update module_to_cil to output hexadecimal for Xen rules da2f2316 libsepol/cil: Use hexadecimal numbers when writing Xen rules af0ce03e libsepol/cil: Add hexadecimal support for Xen ioportcon statements 4ccc267f mcstrans: fix typo in mcstransd.8 man page 6e3c3595 libsepol/cil: do not dereference a NULL pointer when calloc() fails 8c662db9 policycoreutils: fixfiles should handle path arguments more robustly d0fafe03 policycoreutils: fixfiles: handle unexpected spaces in command 1da6fb06 policycoreutils/setfiles: stdout messages don't need program prefix 1ac883f1 policycoreutils/setfiles: don't scramble stdout and stderr together 5ed45797 policycoreutils: fixfiles: remove useless use of cat a83f1cfd libsepol: do not dereference a NULL pointer when stack_init() fails 76f8c04c libsepol: make process_boolean() fail on invalid lines b6579d26 libsepol: constify sepol_genbools()'s boolpath parameter b251dbba libsepol: fix use-after-free in sepol_user_clone() 0438d5c4 libsemanage: do not close uninitialized file descriptors 85da6194 libsemanage: do not dereference a NULL pointer when calloc() fails 03298a22 libsemanage: genhomedircon: fix possible double-free 70a480bf libsepol: Add ability to convert binary policy to CIL 0a08fd1e libsepol: Add ability to convert binary policy to policy.conf file 13c27d6c checkpolicy: Add options to convert binary policy to CIL or a policy.conf 92f22e19 libsepol: In module_to_cil create one attribute for each unique set Bug: 36508258 Test: code compiles and device boots, no obvious problems. Change-Id: Id4b3df6aa651eca267f4fc28af1cfeb8825218c0
Diffstat (limited to 'libselinux/src')
-rw-r--r--libselinux/src/Makefile2
-rw-r--r--libselinux/src/load_policy.c5
-rw-r--r--libselinux/src/selinuxswig.i4
3 files changed, 5 insertions, 6 deletions
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 5640a57d..a277b871 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -2,7 +2,7 @@
# runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build
# targets with "PYPREFIX":
PYTHON ?= python
-PYPREFIX ?= $(notdir $(PYTHON))
+PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])')
RUBY ?= ruby
RUBYPREFIX ?= $(notdir $(RUBY))
PKG_CONFIG ?= pkg-config
diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
index b7e1a6fa..e788c25c 100644
--- a/libselinux/src/load_policy.c
+++ b/libselinux/src/load_policy.c
@@ -79,7 +79,7 @@ int selinux_mkload_policy(int preservebools)
int (*policydb_to_image)(sepol_handle_t *, sepol_policydb_t *, void **, size_t *) = NULL;
int (*genbools_array)(void *data, size_t len, char **names, int *values, int nel) = NULL;
int (*genusers)(void *data, size_t len, const char *usersdir, void **newdata, size_t * newlen) = NULL;
- int (*genbools)(void *data, size_t len, char *boolpath) = NULL;
+ int (*genbools)(void *data, size_t len, const char *boolpath) = NULL;
#ifdef SHARED
char *errormsg = NULL;
@@ -275,8 +275,7 @@ checkbool:
free(names);
}
} else if (setlocaldefs) {
- (void)genbools(data, size,
- (char *)selinux_booleans_path());
+ (void)genbools(data, size, selinux_booleans_path());
}
}
diff --git a/libselinux/src/selinuxswig.i b/libselinux/src/selinuxswig.i
index 687c43bc..dbdb4c3d 100644
--- a/libselinux/src/selinuxswig.i
+++ b/libselinux/src/selinuxswig.i
@@ -18,7 +18,7 @@
%typedef unsigned mode_t;
%typedef unsigned pid_t;
-%typemap(in, numinputs=0) (char ***names, int *len) (char **temp1, int temp2) {
+%typemap(in, numinputs=0) (char ***names, int *len) (char **temp1=NULL, int temp2) {
$1 = &temp1;
$2 = &temp2;
}
@@ -33,7 +33,7 @@
}
}
-%typemap(in, numinputs=0) (char ***) (char **temp) {
+%typemap(in, numinputs=0) (char ***) (char **temp=NULL) {
$1 = &temp;
}