aboutsummaryrefslogtreecommitdiffstats
path: root/libselinux/src/label_internal.h
diff options
context:
space:
mode:
authordcashman <dcashman@google.com>2016-12-12 10:13:27 -0800
committerSandeep Patil <sspatil@google.com>2017-01-04 16:45:32 -0800
commit50400d38203e4db08314168e60c281cc61a717a8 (patch)
treea3a06ff770f353dce51fc0893d7cd3b2d72111d0 /libselinux/src/label_internal.h
parentdb6284efe2b62b7c245d8ee461ca0c21ca2c7a5a (diff)
downloadandroid_external_selinux-50400d38203e4db08314168e60c281cc61a717a8.tar.gz
android_external_selinux-50400d38203e4db08314168e60c281cc61a717a8.tar.bz2
android_external_selinux-50400d38203e4db08314168e60c281cc61a717a8.zip
Add ability to specify multiple input files to the selabel_open.
The file_contexts labeling backend, specified in label_file.c, currently assumes that only one path will be specified as an option to selabel_open(). The split of platform and non-platform policy on device, however, will necessitate the loading of two disparate policy files. Rather than combining the files and then calling the existing API on a newly-formed file, just add the ability to specify multiple files to use. Order of opt specification to selabel_open matters. update: Fixed a double-free in the original change that caused the updater to randomly crash during OTA (b/33938747) Bug: 31363362 Bug: 33938747 Test: Device builds and boots w/no additional denials with split context files. Test: Angler can successfully finish sideloaded OTA with updater binary that is with this change Change-Id: I85cd1525990f6ad054861e62327bd9c2aac03b02 Signed-off-by: Daniel Cashman <dcashman@google.com> Signed-off-by: Sandeep Patil <sspatil@google.com>
Diffstat (limited to 'libselinux/src/label_internal.h')
-rw-r--r--libselinux/src/label_internal.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libselinux/src/label_internal.h b/libselinux/src/label_internal.h
index 3d7ff748..62c1720e 100644
--- a/libselinux/src/label_internal.h
+++ b/libselinux/src/label_internal.h
@@ -108,10 +108,12 @@ struct selabel_handle {
void *data;
/*
- * The main spec file used. Note for file contexts the local and/or
+ * The main spec file(s) used. Note for file contexts the local and/or
* homedirs could also have been used to resolve a context.
*/
- char *spec_file;
+ size_t spec_files_len;
+ char **spec_files;
+
/* substitution support */
struct selabel_sub *dist_subs;