Skip to contentSkip to conversation

policycoreutils: Comment constraint rules in audit2allow and sepolgen output

PATCH Applied Petr Lautrbach 2 participants 2 messages Jul 30, 2015 – Jul 31, 2015 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policycoreutils: Comment constraint rules in audit2allow and sepolgen output

Constraint rules in output need to be commented in order to make a policy compilable.

---
 policycoreutils/audit2allow/audit2allow | 2 +-
 sepolgen/src/sepolgen/policygen.py      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
policycoreutils/audit2allow/audit2allow +1 -1
index 62338a0..6bbab40 100644
@@ -273,7 +273,7 @@ class AuditToPolicy:
             if rc == audit2why.CONSTRAINT:
                 print()  # !!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access.\n"
                 print("#Constraint rule:")
-                print("\n\t" + data[0])
+                print("\n#\t" + data[0])
                 for reason in data[1:]:
                     print("#\tPossible cause is the source %s and target %s are different.\n" % reason)
 
sepolgen/src/sepolgen/policygen.py +1 -1
index 9cacc35..4438a11 100644
@@ -177,7 +177,7 @@ class PolicyGenerator:
             if av.type == audit2why.CONSTRAINT:
                 rule.comment += "\n#!!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access."
                 rule.comment += "\n#Constraint rule: "
-                rule.comment += "\n\t" + av.data[0]
+                rule.comment += "\n#\t" + av.data[0]
                 for reason in av.data[1:]:
                     rule.comment += "\n#\tPossible cause is the source %s and target %s are different." % reason
 
Signature · 1 line
2.4.6
#1 lore raw
Quoted 7 lines · Petr Lautrbach

Constraint rules in output need to be commented in order to make a policy compilable.

Thanks, applied.

Quoted 32 lines
---
 policycoreutils/audit2allow/audit2allow | 2 +-
 sepolgen/src/sepolgen/policygen.py      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
policycoreutils/audit2allow/audit2allow +1 -1
index 62338a0..6bbab40 100644
@@ -273,7 +273,7 @@ class AuditToPolicy:
             if rc == audit2why.CONSTRAINT:
                 print()  # !!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access.\n"
                 print("#Constraint rule:")
-                print("\n\t" + data[0])
+                print("\n#\t" + data[0])
                 for reason in data[1:]:
                     print("#\tPossible cause is the source %s and target %s are different.\n" % reason)
 
sepolgen/src/sepolgen/policygen.py +1 -1
index 9cacc35..4438a11 100644
@@ -177,7 +177,7 @@ class PolicyGenerator:
             if av.type == audit2why.CONSTRAINT:
                 rule.comment += "\n#!!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access."
                 rule.comment += "\n#Constraint rule: "
-                rule.comment += "\n\t" + av.data[0]
+                rule.comment += "\n#\t" + av.data[0]
                 for reason in av.data[1:]:
                     rule.comment += "\n#\tPossible cause is the source %s and target %s are different." % reason