Skip to contentSkip to conversation

Only call gen_requires once.

PATCH Daniel J Walsh 2 participants 2 messages Sep 11, 2008 – Sep 12, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Currently audit2allow/sepolgen will create two identical gen_requires block if you have allow rules and a role statement.

This patch fixes this problem.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjJHroACgkQrlYvE4MpobPgMQCghgAMBtaQO0BeZX+ug6IwsWB8 bNEAoMkRo4cZa0iJhGoGMmCvy5ncGpj8
=gMFg
-----END PGP SIGNATURE-----

sepolgen-1.0.13/src/sepolgen/policygen.py renamed from src/sepolgen/policygen.py +4 -8
diff --exclude-from=exclude -N -u -r nsasepolgen/src/sepolgen/policygen.py policycoreutils-2.0.55/sepolgen-1.0.13/src/sepolgen/policygen.py
@@ -134,6 +134,10 @@
             m.refpolicy = False
 
     def get_module(self):
+        # Generate the requires
+        if self.gen_requires:
+            gen_requires(self.module)
+
         """Return the generated module"""
         return self.module
 
@@ -163,18 +167,10 @@
         # Generate the raw allow rules from the filtered list
         self.__add_allow_rules(raw_allow)
 
-        # Generate the requires
-        if self.gen_requires:
-            gen_requires(self.module)
-
     def add_role_types(self, role_type_set):
         for role_type in role_type_set:
             self.module.children.append(role_type)
 
-        # Generate the requires
-        if self.gen_requires:
-            gen_requires(self.module)
-
 def explain_access(av, ml=None, verbosity=SHORT_EXPLANATION):
     """Explain why a policy statement was generated.
 
#1 lore raw
Quoted 8 lines · Daniel J Walsh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Currently audit2allow/sepolgen will create two identical gen_requires block if you have allow rules and a role statement.

This patch fixes this problem.

Quoted 9 lines

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkjJHroACgkQrlYvE4MpobPgMQCghgAMBtaQO0BeZX+ug6IwsWB8 bNEAoMkRo4cZa0iJhGoGMmCvy5ncGpj8
=gMFg
-----END PGP SIGNATURE-----

Merged in sepolgen 1.0.14

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