Skip to contentSkip to conversation

libselinux: Add openrc_contexts functions

PATCH In review Jason Zaman 1 participant 2 messages Jul 3, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: Add openrc_contexts functions

---
 libselinux/src/file_path_suffixes.h |  1 +
 libselinux/src/selinux_config.c     | 10 +++++++++-
 libselinux/src/selinux_internal.h   |  1 +
 3 files changed, 11 insertions(+), 1 deletion(-)
libselinux/src/file_path_suffixes.h +1 -0
index 95b228b..2d3ca49 100644
@@ -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")
libselinux/src/selinux_config.c +9 -1
index c519a77..88bcc85 100644
@@ -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);
libselinux/src/selinux_internal.h +1 -0
index 9b9145c..3d5c9fb 100644
@@ -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)
Signature · 1 line
2.7.3
#1 lore raw

I completely screwed up this patch, please ignore it. I missed another header file.

Quoted 61 lines · Jason Zaman
---
 libselinux/src/file_path_suffixes.h |  1 +
 libselinux/src/selinux_config.c     | 10 +++++++++-
 libselinux/src/selinux_internal.h   |  1 +
 3 files changed, 11 insertions(+), 1 deletion(-)
libselinux/src/file_path_suffixes.h +1 -0
index 95b228b..2d3ca49 100644
@@ -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")
libselinux/src/selinux_config.c +9 -1
index c519a77..88bcc85 100644
@@ -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);
libselinux/src/selinux_internal.h +1 -0
index 9b9145c..3d5c9fb 100644
@@ -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)
Signature · 1 line
2.7.3