Skip to contentSkip to conversation

Booleans

PATCH In review Ivan Gyurdiev 1 participant 1 message Jul 21, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 Booleans

The following patch is intended to replace genbools.c (but not yet). It provides functions to load booleans into a policydb object. It uses a structure (sepol_boolinfo_t) as the higher level representation for a boolean, and takes out file operations and parsing.

libsepol-bools.diff

include/sepol/booleans.h +23 -0
diff -aru libsepol.work/include/sepol/booleans.h libsepol-bools/include/sepol/booleans.h
@@ -0,0 +1,23 @@
+#ifndef _SEPOL_BOOLEANS_H_
+#define _SEPOL_BOOLEANS_H_
+
+#include <sepol/policydb.h>
+
+/* High level representation of a boolean */
+typedef struct sepol_boolinfo {
+	char* name;
+	int value;
+} sepol_boolinfo_t;
+
+/* Load a boolean into the policy */
+extern int sepol_bool_load (
+	policydb_t* policydb, 
+	sepol_boolinfo_t* boolean);
+
+/* Load a boolean array into the policy */
+extern int sepol_bool_load_array(
+	policydb_t* policydb,
+	sepol_boolinfo_t* bool_arr,
+	int bool_arr_len);
+
+#endif /* _SEPOL_BOOLEANS_H_ */
src/booleans.c +79 -0

79 lines not on this page · raw message