diff options
author | Jason Zaman <jason@perfinion.com> | 2016-09-22 22:43:57 +0800 |
---|---|---|
committer | Stephen Smalley <sds@tycho.nsa.gov> | 2016-09-22 13:27:45 -0400 |
commit | 09d99e8bec6e112598518c08a90d9423e61c8540 (patch) | |
tree | ccd8a69aaad6d3d0c977fd1f8732ebcfc811c47f /libselinux/src | |
parent | 1389d125e75f719087238fbba0e1fad40fd31c01 (diff) | |
download | android_external_selinux-09d99e8bec6e112598518c08a90d9423e61c8540.tar.gz android_external_selinux-09d99e8bec6e112598518c08a90d9423e61c8540.tar.bz2 android_external_selinux-09d99e8bec6e112598518c08a90d9423e61c8540.zip |
libselinux: Add openrc_contexts functions
The file will initially contain:
run_init=run_init_t
There can not be any spaces around the = since OpenRC's existing config
files and the methods it uses require it.
Signed-off-by: Jason Zaman <jason@perfinion.com>
Diffstat (limited to 'libselinux/src')
-rw-r--r-- | libselinux/src/file_path_suffixes.h | 1 | ||||
-rw-r--r-- | libselinux/src/selinux_config.c | 10 | ||||
-rw-r--r-- | libselinux/src/selinux_internal.h | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/libselinux/src/file_path_suffixes.h b/libselinux/src/file_path_suffixes.h index 95b228bd..2d3ca497 100644 --- a/libselinux/src/file_path_suffixes.h +++ b/libselinux/src/file_path_suffixes.h @@ -23,6 +23,7 @@ S_(BINPOLICY, "/policy/policy") S_(VIRTUAL_DOMAIN, "/contexts/virtual_domain_context") S_(VIRTUAL_IMAGE, "/contexts/virtual_image_context") S_(LXC_CONTEXTS, "/contexts/lxc_contexts") + S_(OPENRC_CONTEXTS, "/contexts/openrc_contexts") S_(OPENSSH_CONTEXTS, "/contexts/openssh_contexts") S_(SNAPPERD_CONTEXTS, "/contexts/snapperd_contexts") S_(SYSTEMD_CONTEXTS, "/contexts/systemd_contexts") diff --git a/libselinux/src/selinux_config.c b/libselinux/src/selinux_config.c index c519a778..88bcc856 100644 --- a/libselinux/src/selinux_config.c +++ b/libselinux/src/selinux_config.c @@ -51,7 +51,8 @@ #define OPENSSH_CONTEXTS 28 #define SYSTEMD_CONTEXTS 29 #define SNAPPERD_CONTEXTS 30 -#define NEL 31 +#define OPENRC_CONTEXTS 31 +#define NEL 32 /* Part of one-time lazy init */ static pthread_once_t once = PTHREAD_ONCE_INIT; @@ -493,6 +494,13 @@ const char *selinux_lxc_contexts_path(void) hidden_def(selinux_lxc_contexts_path) +const char *selinux_openrc_contexts_path(void) +{ + return get_path(OPENRC_CONTEXTS); +} + +hidden_def(selinux_openrc_contexts_path) + const char *selinux_openssh_contexts_path(void) { return get_path(OPENSSH_CONTEXTS); diff --git a/libselinux/src/selinux_internal.h b/libselinux/src/selinux_internal.h index 9b9145cc..3d5c9fb4 100644 --- a/libselinux/src/selinux_internal.h +++ b/libselinux/src/selinux_internal.h @@ -83,6 +83,7 @@ hidden_proto(selinux_mkload_policy) hidden_proto(selinux_media_context_path) hidden_proto(selinux_x_context_path) hidden_proto(selinux_sepgsql_context_path) + hidden_proto(selinux_openrc_contexts_path) hidden_proto(selinux_openssh_contexts_path) hidden_proto(selinux_snapperd_contexts_path) hidden_proto(selinux_systemd_contexts_path) |