[PATCH v2 08/13] python/sepolgen: remove buggy code

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

 



av_extract_params() may call __param_insert() with only 2 parameters
instead of 4, which has no chance to work fine. Moreover it uses "PERM",
which is undefined. As nobody complained about this code, it seems to be
dead, so remove it.

This issue has been found using flake8. This Python linter reported:

    python/sepolgen/src/sepolgen/interfaces.py:158:37: F821 undefined
    name 'PERM'

While at it, fix a typo in a comment.

Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>
---
 python/sepolgen/src/sepolgen/interfaces.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/python/sepolgen/src/sepolgen/interfaces.py b/python/sepolgen/src/sepolgen/interfaces.py
index 48ae4f27a414..f4d3e5c5d6e0 100644
--- a/python/sepolgen/src/sepolgen/interfaces.py
+++ b/python/sepolgen/src/sepolgen/interfaces.py
@@ -112,7 +112,7 @@ def av_extract_params(av, params):
     entries in the dict, but if an unresolvable conflict is
     found it is reported to the caller.
 
-    The goal here is to figure out how interface paramaters are
+    The goal here is to figure out how interface parameters are
     actually used in the interface - e.g., that $1 is a domain used as
     a SRC_TYPE. In general an interface will look like this:
 
@@ -153,11 +153,6 @@ def av_extract_params(av, params):
         if __param_insert(av.obj_class, refpolicy.OBJ_CLASS, av, params) == 1:
             ret = 1
 
-    for perm in av.perms:
-        if access.is_idparam(perm):
-            if __param_insert(perm, PERM) == 1:
-                ret = 1
-
     return ret
 
 def role_extract_params(role, params):
-- 
2.18.0

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



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

  Powered by Linux