Skip to contentSkip to conversation

Initial policyrep patch v3

PATCH In review Karl MacMillan 2 participants 2 messages Jul 11, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Initial policyrep patch v3

Initial patch to create a new policyrep branch using C++. This patch includes basic classes for representing policy (Node and Parent), a few policy objects, a bison parser, a boost::python binding, and basic test infrastructure.

Includes updates based on comments from James Antill and Josh Brindle.
* * *

---

Makefile +1 -1
diff -r bb8d5ba48746 -r c438376dfb35 Makefile
@@ -1,4 +1,4 @@ SUBDIRS=libsepol libselinux libsemanage 
-SUBDIRS=libsepol libselinux libsemanage sepolgen checkpolicy policycoreutils # policy
+SUBDIRS=libsepol libselinux libsemanage libpolicyrep sepolgen checkpolicy policycoreutils # policy
 PYSUBDIRS=libselinux libsemanage
 
 ifeq ($(DEBUG),1)
libpolicyrep/Makefile +22 -0
diff -r bb8d5ba48746 -r c438376dfb35 libpolicyrep/Makefile
@@ -0,0 +1,22 @@
+all: 
+	$(MAKE) -C src 
+
+install: 
+	$(MAKE) -C include install
+	$(MAKE) -C src install
+
+relabel:
+	$(MAKE) -C src relabel
+
+clean:
+	$(MAKE) -C src clean
+	$(MAKE) -C tests clean
+
+indent:
+	$(MAKE) -C src $@
+	$(MAKE) -C include $@
+	$(MAKE) -C utils $@
+
+test: all
+	$(MAKE) -C tests test
+
libpolicyrep/include/Makefile +10 -0
diff -r bb8d5ba48746 -r c438376dfb35 libpolicyrep/include/Makefile
@@ -0,0 +1,10 @@
+# Installation directories.
+PREFIX ?= $(DESTDIR)/usr
+INCDIR ?= $(PREFIX)/include/policyrep
+
+install:
+	test -d $(INCDIR) || install -m 755 -d $(INCDIR)
+	install -m 644 $(wildcard policyrep/*.hpp) $(INCDIR)
+
+indent:
+	../../scripts/Lindent $(wildcard policyrep/*.hpp)
libpolicyrep/include/policyrep/conditional.hpp +136 -0

136 lines not on this page · raw message

libpolicyrep/include/policyrep/idset.hpp +33 -0
diff -r bb8d5ba48746 -r c438376dfb35 libpolicyrep/include/policyrep/idset.hpp
@@ -0,0 +1,33 @@
+/* Author: Karl MacMillan <[email protected]> */
+
+#ifndef __idset_hpp__
+#define __idset_hpp__
+
+#include <policyrep/policy_base.hpp>
+
+#include <set>
+
+namespace policyrep
+{
+	struct IdSetImpl;
+	class IdSet
+	{
+	public:
+		IdSet();
+		IdSet(const IdSet& other);
+		~IdSet();
+		void operator=(const IdSet& other);
+
+		void set_compl(bool val);
+		bool get_compl() const;
+
+		StringSet& ids();
+	protected:
+		void init();
+		IdSetImpl* impl;
+	};
+
+
+} // namespace policyrep
+
+#endif
libpolicyrep/include/policyrep/object_class.hpp +83 -0

83 lines not on this page · raw message

libpolicyrep/include/policyrep/parse.hpp +47 -0

47 lines not on this page · raw message

libpolicyrep/include/policyrep/policy.hpp +86 -0

86 lines not on this page · raw message

libpolicyrep/include/policyrep/policy_base.hpp +183 -0

183 lines not on this page · raw message

libpolicyrep/include/policyrep/rule.hpp +71 -0

71 lines not on this page · raw message

libpolicyrep/include/policyrep/te_decl.hpp +144 -0

144 lines not on this page · raw message

libpolicyrep/src/Makefile +76 -0

76 lines not on this page · raw message

libpolicyrep/src/conditional.cpp +380 -0

380 lines not on this page · raw message

libpolicyrep/src/idset.cpp +67 -0

67 lines not on this page · raw message

libpolicyrep/src/object_class.cpp +153 -0

153 lines not on this page · raw message

libpolicyrep/src/parse.cpp +107 -0

107 lines not on this page · raw message

libpolicyrep/src/policy.cpp +181 -0

181 lines not on this page · raw message

libpolicyrep/src/policy_base.cpp +533 -0

533 lines not on this page · raw message

libpolicyrep/src/policy_base_internal.hpp +42 -0

42 lines not on this page · raw message

libpolicyrep/src/policy_internal.hpp new file +1 -0
diff -r bb8d5ba48746 -r c438376dfb35 libpolicyrep/src/policy_internal.hpp
@@ -0,0 +1,1 @@
+
libpolicyrep/src/policy_parse.y +766 -0

640 lines not on this page · raw message

libpolicyrep/src/policy_scan.l +275 -0

275 lines not on this page · raw message

libpolicyrep/src/policyrep_python.cpp +250 -0

250 lines not on this page · raw message

libpolicyrep/src/rule.cpp +235 -0

235 lines not on this page · raw message

libpolicyrep/src/te_decl.cpp +252 -0

252 lines not on this page · raw message

libpolicyrep/tests/Makefile +24 -0
diff -r bb8d5ba48746 -r c438376dfb35 libpolicyrep/tests/Makefile

Lines of this file are not shown. View the raw message.

libpolicyrep/tests/example.te +29 -0
diff -r bb8d5ba48746 -r c438376dfb35 libpolicyrep/tests/example.te

Lines of this file are not shown. View the raw message.

libpolicyrep/tests/libpolicyrep-test.cpp +66 -0

66 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

--
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.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 10 lines · Karl MacMillan

Initial patch to create a new policyrep branch using C++. This patch includes basic classes for representing policy (Node and Parent), a few policy objects, a bison parser, a boost::python binding, and basic test infrastructure.

Includes updates based on comments from James Antill and Josh Brindle.
* * *

---

Acked and merged into a new policyrep branch. Now we can have incremental patches instead of giant ones :)

--
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.