[PATCH 15/15] [src-policy] semanage: source permissive module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This changes the permissive module generation to create a source refpol
module instead of a policy package.
---
 policycoreutils/semanage/seobject.py |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py
index 0aa7759..82132f3 100644
--- a/policycoreutils/semanage/seobject.py
+++ b/policycoreutils/semanage/seobject.py
@@ -274,26 +274,21 @@ class permissiveRecords(semanageRecords):
                dirname = tempfile.mkdtemp("-semanage")
                savedir = os.getcwd()
                os.chdir(dirname)
-               filename = "%s.te" % name
+               filename = "%s.ref" % name
                modtxt = """
-module %s 1.0;
+policy_module(%s, 1.0)
 
-require {
+gen_require(`
           type %s;
-}
+')
 
 permissive %s;
 """ % (name, type, type)
                fd = open(filename, 'w')
                fd.write(modtxt)
                fd.close()
-               mc = module.ModuleCompiler()
-               mc.create_module_package(filename, 1)
-               fd = open("permissive_%s.pp" % type)
-               data = fd.read()
-               fd.close()
 
-               rc = semanage_module_install(self.sh, data, len(data));
+               rc = semanage_module_install_file(self.sh, filename)
                if rc >= 0:
                       self.commit()
 
-- 
1.6.3.3


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

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux