Skip to contentSkip to conversation

netfilter integration: add netfilter_contexts path to libselinux

PATCH In review Christopher J. PeBenito 2 participants 2 messages Jul 17, 2006 – Jul 18, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 netfilter integration: add netfilter_contexts path to libselinux

Adds a netfilter_contexts path in the contexts dir of the policy to libselinux.

 libselinux/include/selinux/selinux.h |    1 +
 libselinux/src/file_path_suffixes.h  |    1 +
 libselinux/src/selinux_config.c      |   10 +++++++++-
 libselinux/src/selinux_internal.h    |    1 +
 4 files changed, 12 insertions(+), 1 deletion(-)
libselinux/include/selinux/selinux.h +1 -0
diff --exclude .svn -purN trunk/libselinux/include/selinux/selinux.h netfilter-integration/libselinux/include/selinux/selinux.h
@@ -398,6 +398,7 @@ extern "C" {
 	extern const char *selinux_users_path(void);
 	extern const char *selinux_usersconf_path(void);
 	extern const char *selinux_translations_path(void);
+	extern const char *selinux_netfilter_context_path(void);
 	extern const char *selinux_path(void);
 
 /* Check a permission in the passwd class.
libselinux/src/file_path_suffixes.h +1 -0
diff --exclude .svn -purN trunk/libselinux/src/file_path_suffixes.h netfilter-integration/libselinux/src/file_path_suffixes.h
@@ -14,3 +14,4 @@ S_(BINPOLICY, "/policy/policy")
     S_(USERS_DIR, "/users/")
     S_(SEUSERS, "/seusers")
     S_(TRANSLATIONS, "/setrans.conf")
+    S_(NETFILTER_CONTEXTS, "/contexts/netfilter_contexts")
libselinux/src/selinux_config.c +9 -1
diff --exclude .svn -purN trunk/libselinux/src/selinux_config.c netfilter-integration/libselinux/src/selinux_config.c
@@ -35,7 +35,8 @@
 #define USERS_DIR         12
 #define SEUSERS           13
 #define TRANSLATIONS      14
-#define NEL               15
+#define NETFILTER_CONTEXTS    15
+#define NEL               16
 
 /* New layout is relative to SELINUXDIR/policytype. */
 static char *file_paths[NEL];
@@ -384,3 +385,10 @@ const char *selinux_translations_path()
 }
 
 hidden_def(selinux_translations_path)
+
+const char *selinux_netfilter_context_path()
+{
+	return get_path(NETFILTER_CONTEXTS);
+}
+
+hidden_def(selinux_netfilter_context_path)
libselinux/src/selinux_internal.h +1 -0
diff --exclude .svn -purN trunk/libselinux/src/selinux_internal.h netfilter-integration/libselinux/src/selinux_internal.h
@@ -54,6 +54,7 @@ hidden_proto(selinux_mkload_policy)
     hidden_proto(selinux_failsafe_context_path)
     hidden_proto(selinux_removable_context_path)
     hidden_proto(selinux_file_context_path)
+    hidden_proto(selinux_netfilter_context_path)
     hidden_proto(selinux_homedir_context_path)
     hidden_proto(selinux_user_contexts_path)
     hidden_proto(selinux_booleans_path)
Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 9 lines · Christopher J. PeBenito

Adds a netfilter_contexts path in the contexts dir of the policy to libselinux.

 libselinux/include/selinux/selinux.h |    1 +
 libselinux/src/file_path_suffixes.h  |    1 +
 libselinux/src/selinux_config.c      |   10 +++++++++-
 libselinux/src/selinux_internal.h    |    1 +
 4 files changed, 12 insertions(+), 1 deletion(-)

Does anything need to be done to make to export this to the python wrappers?

Karl

Quoted 49 lines

diff --exclude .svn -purN trunk/libselinux/include/selinux/selinux.h netfilter-integration/libselinux/include/selinux/selinux.h

libselinux/include/selinux/selinux.h +1 -0
@@ -398,6 +398,7 @@ extern "C" {
 	extern const char *selinux_users_path(void);
 	extern const char *selinux_usersconf_path(void);
 	extern const char *selinux_translations_path(void);
+	extern const char *selinux_netfilter_context_path(void);
 	extern const char *selinux_path(void);
 
 /* Check a permission in the passwd class.

diff --exclude .svn -purN trunk/libselinux/src/file_path_suffixes.h netfilter-integration/libselinux/src/file_path_suffixes.h

libselinux/src/file_path_suffixes.h +1 -0
@@ -14,3 +14,4 @@ S_(BINPOLICY, "/policy/policy")
     S_(USERS_DIR, "/users/")
     S_(SEUSERS, "/seusers")
     S_(TRANSLATIONS, "/setrans.conf")
+    S_(NETFILTER_CONTEXTS, "/contexts/netfilter_contexts")

diff --exclude .svn -purN trunk/libselinux/src/selinux_config.c netfilter-integration/libselinux/src/selinux_config.c

libselinux/src/selinux_config.c +9 -1
@@ -35,7 +35,8 @@
 #define USERS_DIR         12
 #define SEUSERS           13
 #define TRANSLATIONS      14
-#define NEL               15
+#define NETFILTER_CONTEXTS    15
+#define NEL               16
 
 /* New layout is relative to SELINUXDIR/policytype. */
 static char *file_paths[NEL];
@@ -384,3 +385,10 @@ const char *selinux_translations_path()
 }
 
 hidden_def(selinux_translations_path)
+
+const char *selinux_netfilter_context_path()
+{
+	return get_path(NETFILTER_CONTEXTS);
+}
+
+hidden_def(selinux_netfilter_context_path)

diff --exclude .svn -purN trunk/libselinux/src/selinux_internal.h netfilter-integration/libselinux/src/selinux_internal.h

libselinux/src/selinux_internal.h hidden_proto(selinux_mkload_policy) · line 60

Quoted 7 lines
libselinux/src/selinux_internal.h +1 -0
@@ -54,6 +54,7 @@ hidden_proto(selinux_mkload_policy)
     hidden_proto(selinux_failsafe_context_path)
     hidden_proto(selinux_removable_context_path)
     hidden_proto(selinux_file_context_path)
+    hidden_proto(selinux_netfilter_context_path)
     hidden_proto(selinux_homedir_context_path)
     hidden_proto(selinux_user_contexts_path)
     hidden_proto(selinux_booleans_path)

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.