From patchwork Fri Aug 19 03:45:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Zaman X-Patchwork-Id: 9289295 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 840C86077B for ; Fri, 19 Aug 2016 03:48:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72E1C28A5B for ; Fri, 19 Aug 2016 03:48:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6786128A80; Fri, 19 Aug 2016 03:48:09 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4AC128A5B for ; Fri, 19 Aug 2016 03:48:08 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.28,543,1464652800"; d="scan'208";a="16746166" IronPort-PHdr: =?us-ascii?q?9a23=3AH6r9axVJnR71z1zQpNwgEecwS/DV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZhOGt8tkgFKBZ4jH8fUM07OQ6PG5HzZdqsnR+DBaKdoXBkdD0Z?= =?us-ascii?q?1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYn?= =?us-ascii?q?br+tQt2asc272qiI9oHJZE0Q3XzmMOo0dkj98lWZ9pFPx9AzcuBpklqBi0ALUt?= =?us-ascii?q?we/XlvK1OXkkS0zeaL17knzR5tvek8/dVLS6TwcvdwZ7VZCDM7LzJ9v5Wz5lH+?= =?us-ascii?q?Vw/H2l8wGiVTy0IJUED560ThU5PwtDbqnvZs0ymde8vtRPY7Xirxwb1sTUrKgT?= =?us-ascii?q?wAMXYL+WTejIQkjqtApxSJvxFlzY/SYYaTcvF5e/WOLpshWWNdU5MJBGR6CYSm?= =?us-ascii?q?Yt5KVrIM?= X-IPAS-Result: =?us-ascii?q?A2HYBQARgbZX/wHyM5BeHAEBgnktgVK5XyKBeYV3TAEBAQE?= =?us-ascii?q?BAQECAQJbJ4IyBAMRfVs9AgEDAQIPKAYBAQwgDAIDCQEBFykICAMBLQMBBQELE?= =?us-ascii?q?Q4LBRgEAYgPAZ5ZgTI+MopVhSsBAQWLSykIEIQPimoRAWiFD48YijSPIGWIYSW?= =?us-ascii?q?FX451MYEPVIIFggJjAYV2gTYBAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 19 Aug 2016 03:48:07 +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 u7J3m3SI022619; Thu, 18 Aug 2016 23:48:04 -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 u7J3jXHX009824 for ; Thu, 18 Aug 2016 23:45:33 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u7J3jWYT022466 for ; Thu, 18 Aug 2016 23:45:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1DDAACMgLZXhsTAVdFeHQGCeYF/tVyEDIYdAoFqTAEBAQEBAQECEwEBAQgLCwkZhQ4CAQMSLgEBNwEPUTQBBQEcGSKIDwGeVYEyPjKKVYUrAQEFi0sBAQEBAQUCARwIEIQPi2SBfQuDB48YijSPIGWIYYYEjnUxgQ+CWR6BZGMBhywBAQE X-IPAS-Result: A1DDAACMgLZXhsTAVdFeHQGCeYF/tVyEDIYdAoFqTAEBAQEBAQECEwEBAQgLCwkZhQ4CAQMSLgEBNwEPUTQBBQEcGSKIDwGeVYEyPjKKVYUrAQEFi0sBAQEBAQUCARwIEIQPi2SBfQuDB48YijSPIGWIYYYEjnUxgQ+CWR6BZGMBhywBAQE X-IronPort-AV: E=Sophos;i="5.28,543,1464667200"; d="scan'208";a="5653735" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 18 Aug 2016 23:45:32 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3ADLAI1haDBAyXt9m04qX7paT/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcm8bnLW6fgltlLVR4KTs6sC0LuP9fq9EjNQqdbZ6TZZIcQKD0dEwe?= =?us-ascii?q?wt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEt?= =?us-ascii?q?fre9JIfegoyN2vyo/NWLOkMT1WP7O+45c0X+7V2I8JJH2c06cud54yCKi0MAQ/?= =?us-ascii?q?5Ry2JsKADbtDfHzeD0wqRe9T9Nsekq7c9KXPayVa05SbtFEGZuaDhtt4W4/SXE?= =?us-ascii?q?GBCC4noaT3U+jgtDAw+D6grzGJj2rHjUrO14jQuTJsrwBYI9XD2kp/NpQQTvjg?= =?us-ascii?q?8fOiQ38WfWjco2h6Ve9kHy7ydjypLZNdnGfMF1ebnQKIsX?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0GVAQCcf7ZXhsTAVdFeHQGCeYF/tVyED?= =?us-ascii?q?IIShAsCgWpMAQEBAQEBAQIBAhABAQEICwsJGS+CMhZ/Wz0CAQMSLgEBNwEPUTQ?= =?us-ascii?q?BBQEcGSKIDwGeT4EyPjKKVYUrAQEFi0sBAQEBAQUCARwIEIQPi2SBfQuDB48Yi?= =?us-ascii?q?jSPIGWIYYYEjnUxgQ+CWR6BZGMBhywBAQE?= X-IPAS-Result: =?us-ascii?q?A0GVAQCcf7ZXhsTAVdFeHQGCeYF/tVyEDIIShAsCgWpMAQE?= =?us-ascii?q?BAQEBAQIBAhABAQEICwsJGS+CMhZ/Wz0CAQMSLgEBNwEPUTQBBQEcGSKIDwGeT?= =?us-ascii?q?4EyPjKKVYUrAQEFi0sBAQEBAQUCARwIEIQPi2SBfQuDB48YijSPIGWIYYYEjnU?= =?us-ascii?q?xgQ+CWR6BZGMBhywBAQE?= X-IronPort-AV: E=Sophos;i="5.28,543,1464652800"; d="scan'208";a="16746146" Received: from mail-pf0-f196.google.com ([209.85.192.196]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 19 Aug 2016 03:45:31 +0000 Received: by mail-pf0-f196.google.com with SMTP id h186so747862pfg.2 for ; Thu, 18 Aug 2016 20:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perfinion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B/UPDYPcfUMDll2qKBHHvNe4GkDjbhQUQ++oCJsVfEQ=; b=zEub6128JdG6VaqMrtmQah2u9q2gYBmp+WltxGb29UlgqHQIWB5Vnt4FMGSeur/WW4 mbmwzXHM+5O+/zlwwfbkFd+9p8ZzeyPFJj9wZHqZD1rVwih2/eJOrwd2wjGSLvokvy74 Ikpkcwkck2N3ZxgiCpce+8FQvZAJi7ttOqeiERfDl+fTGk4lUt3govIFvv3OmhUnvAb4 coPiTAXB5uGvYS3s2JbLow3GiKW2iG9b72Dps6Ng28KqpvEW+rM32G5HIRNb7KDVkya0 OjXbWwuCnwl+KI5YVOxOkESiyltb4I0mXEaRkY9b5QOSrqzvVNAQli0w2uyC/aLTpJxv 7GYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B/UPDYPcfUMDll2qKBHHvNe4GkDjbhQUQ++oCJsVfEQ=; b=AXCS1DcLANziOwaqTj47OxpiI2bP5W/wNSwBq2hjHTKHPHfQTQYojy0doPRroFul2s 4PIg5i6ZVJHLu6+vY7MgvMz+hsIimIgw0248tLkoixO1uf8VfHTokMvJKOMjDeuGuuFF xB06GhCJyhVOUFouZwEMvoHFIvXLLRHUono4cD4BAy+WRJ0dPjgSBrTNjzjYvLZr6/bd 1L4S590Hx9kOCiyeOkU+vqe9QULfpEmFwXtnzAxiiPuJhDVdfrMrKeLFcfFdzKN00lt/ UwF5ytMzPm/trUu24IHd4L6DGF41FOwr4vyrp6fEDAvognVK2xHftUzYNi14XenqNKJl UrBA== X-Gm-Message-State: AEkoouvkNU6UQxh3sxb9XvZRSJMwYWTZEoOrPzbnPxsFhd8Y924H7xtXmVA7bkOnfdM1HQ== X-Received: by 10.98.30.133 with SMTP id e127mr10367593pfe.104.1471578329403; Thu, 18 Aug 2016 20:45:29 -0700 (PDT) Received: from localhost ([2404:e800:e600:57b:88c4:1498:f95a:1537]) by smtp.gmail.com with ESMTPSA id p67sm2073686pfg.22.2016.08.18.20.45.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 20:45:28 -0700 (PDT) From: Jason Zaman To: selinux@tycho.nsa.gov Subject: [PATCH 2/3] audit2allow: fix audit2why import from seobject. Date: Fri, 19 Aug 2016 11:45:16 +0800 Message-Id: <1471578317-22785-2-git-send-email-jason@perfinion.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1471578317-22785-1-git-send-email-jason@perfinion.com> References: <1471578317-22785-1-git-send-email-jason@perfinion.com> 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: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Commit b43991f9135e5422fd1058ecbd427ae6c9283eab broke audit2why because boolean_desc was imported indirectly via seobject. Use it directly from sepolicy instead. $ cd policycoreutils/audit2allow $ make test test_audit2why (__main__.Audit2allowTests) Verify audit2why works ... Traceback (most recent call last): File "/bin/audit2why", line 365, in app.main() File "/bin/audit2why", line 353, in main self.__output() File "/bin/audit2why", line 295, in __output return self.__output_audit2why() File "/bin/audit2why", line 263, in __output_audit2why print("\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0])) AttributeError: 'module' object has no attribute 'boolean_desc' FAIL Signed-off-by: Jason Zaman --- policycoreutils/audit2allow/audit2allow | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/policycoreutils/audit2allow/audit2allow b/policycoreutils/audit2allow/audit2allow index e23e418..4b50c5b 100644 --- a/policycoreutils/audit2allow/audit2allow +++ b/policycoreutils/audit2allow/audit2allow @@ -240,7 +240,7 @@ class AuditToPolicy: def __output_audit2why(self): import selinux - import seobject + import sepolicy for i in self.__parser.avc_msgs: rc = i.type data = i.data @@ -260,11 +260,11 @@ class AuditToPolicy: if len(data) > 1: print("\tOne of the following booleans was set incorrectly.") for b in data: - print("\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0])) + print("\tDescription:\n\t%s\n" % sepolicy.boolean_desc(b[0])) print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (b[0], b[1])) else: print("\tThe boolean %s was set incorrectly. " % (data[0][0])) - print("\tDescription:\n\t%s\n" % seobject.boolean_desc(data[0][0])) + print("\tDescription:\n\t%s\n" % sepolicy.boolean_desc(data[0][0])) print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (data[0][0], data[0][1])) continue