From patchwork Thu Aug 18 12:40:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Smalley X-Patchwork-Id: 9287513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F078600CB for ; Thu, 18 Aug 2016 12:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F51E26785 for ; Thu, 18 Aug 2016 12:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23DBA26A99; Thu, 18 Aug 2016 12:39:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (emsm-gh1-uea10.nsa.gov [8.44.101.8]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67ECD28F8F for ; Thu, 18 Aug 2016 12:39:50 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.28,539,1464652800"; d="scan'208";a="16711990" IronPort-PHdr: =?us-ascii?q?9a23=3AZ+9+hxBUYfxIQM11Gh2CUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP78pMbcNUDSrc9gkEXOFd2CrakV0qyM7+u9ACRAuc/H6yFaNsQUFlcsso?= =?us-ascii?q?Y/p0QYGsmLCEn2frbBThcRO4B8bmJj5GyxKkNPGczzNBX4q3y26iMOSF2kbVIm?= =?us-ascii?q?btr8FoOatcmrzef6o8SVOFQRwmDhKu4rZFXu9EOK55FQ2dMjYo8KiTLx6kNSfO?= =?us-ascii?q?pXwW46bXmypD3bovmKwZh47i5LsOgg/cMTGY/zfqA/UKAKRG9+azN92dfv/SXn?= =?us-ascii?q?YUPPoyFEEzZerh0dGAXB7RfnTr/toyD6sax7wyDcMsroHp4uXjH31LtmUB/ljm?= =?us-ascii?q?88Mjc99GzGwphrgLlzvAOqpxs5xZXdJo6SKqwtLevmYdoGSD8ZDY5qXCtbD9b5?= =?us-ascii?q?NdMC?= X-IPAS-Result: =?us-ascii?q?A2H2BwD6q7VX/wHyM5BeGgEBAQGDJVZtD6VVAZN7IwOBdoV?= =?us-ascii?q?4TAEBAQEBAQECAQJbJ4IyBAMRfVtEAjcUIAsDAwkCFykICAMBLRUfCwUYBIgQv?= =?us-ascii?q?CYljEGCRgIRAWiFDwWZRIYgiH4CgjeHNIVaApAzVIQWUoVoDxeBHwEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 18 Aug 2016 12:39:27 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u7ICcxAY020019; Thu, 18 Aug 2016 08:39:06 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u7ICcpGi288314 for ; Thu, 18 Aug 2016 08:38:51 -0400 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u7ICco1h020011; Thu, 18 Aug 2016 08:38:50 -0400 From: Stephen Smalley To: selinux@tycho.nsa.gov Subject: [PATCH] semanage: Fix semanage fcontext -D Date: Thu, 18 Aug 2016 08:40:44 -0400 Message-Id: <1471524044-30532-1-git-send-email-sds@tycho.nsa.gov> X-Mailer: git-send-email 2.7.4 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: Stephen Smalley MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP commit 4c5b8a956829ba464046a92f7dcc19806458f6b3 ("semanage: add auditing of changes in records") broke semanage fcontext -D. Fix it. Signed-off-by: Stephen Smalley --- policycoreutils/semanage/seobject.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py index a6681f0..ae87509 100644 --- a/policycoreutils/semanage/seobject.py +++ b/policycoreutils/semanage/seobject.py @@ -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