Skip to contentSkip to conversation

semanage: Fix semanage fcontext -D

PATCH New Stephen Smalley 1 participant 1 message Aug 18, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 semanage: Fix semanage fcontext -D

commit 4c5b8a956829ba464046a92f7dcc19806458f6b3 ("semanage: add auditing of changes in records") broke semanage fcontext -D. Fix it.

---
 policycoreutils/semanage/seobject.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
policycoreutils/semanage/seobject.py +2 -1
index a6681f0..ae87509 100644
@@ -90,6 +90,7 @@ file_type_str_to_option = {"all files": "a",
                            "named pipe": "p"}
 
 ftype_to_audit = {"": "any",
+                  "a" : "any",
                   "b": "block",
                   "c": "char",
                   "d": "dir",
@@ -2018,7 +2019,7 @@ class fcontextRecords(semanageRecords):
                 raise ValueError(_("Could not delete the file context %s") % target)
             semanage_fcontext_key_free(k)
 
-            self.mylog.log_change("resrc=fcontext op=delete %s ftype=%s" % (audit.audit_encode_nv_string("tglob", target, 0), ftype_to_audit[ftype_str]))
+            self.mylog.log_change("resrc=fcontext op=delete %s ftype=%s" % (audit.audit_encode_nv_string("tglob", target, 0), ftype_to_audit[file_type_str_to_option[ftype_str]]))
 
         self.equiv = {}
         self.equal_ind = True
Signature · 1 line
2.7.4