From patchwork Wed Sep 27 08:16:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vit Mojzis X-Patchwork-Id: 9973385 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 6BB9760365 for ; Wed, 27 Sep 2017 08:19:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D1BA285EC for ; Wed, 27 Sep 2017 08:19:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 524FE29109; Wed, 27 Sep 2017 08:19:21 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from ucol19pa09.eemsg.mail.mil (ucol19pa09.eemsg.mail.mil [214.24.24.82]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAE02285EC for ; Wed, 27 Sep 2017 08:19:20 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.42,444,1500940800"; d="scan'208";a="535625913" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by ucol19pa09.eemsg.mail.mil with ESMTP; 27 Sep 2017 08:19:20 +0000 Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 27 Sep 2017 08:19:20 +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 v8R8JJBb015427; Wed, 27 Sep 2017 04:19:19 -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 v8R8HFx6170615 for ; Wed, 27 Sep 2017 04:17:15 -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 v8R8HEnM014922 for ; Wed, 27 Sep 2017 04:17:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1BrAgB5XctZfyoYGNZbHAEBBAEBCgEBg?= =?us-ascii?q?zEoZ24njwmPCJozCiOFGAKEVlcBAgEBAQEBAhMBAQsWhXYDA4EJUVeIeIFSAw2?= =?us-ascii?q?qbIsCAQsmgyuCAoFRhmOBYYIehScFoSCHXoxyDYJuiFyHO5VHgTmBZVMlFUmHH?= =?us-ascii?q?3QBiCoBAQE?= X-IPAS-Result: =?us-ascii?q?A1BrAgB5XctZfyoYGNZbHAEBBAEBCgEBgzEoZ24njwmPCJo?= =?us-ascii?q?zCiOFGAKEVlcBAgEBAQEBAhMBAQsWhXYDA4EJUVeIeIFSAw2qbIsCAQsmgyuCA?= =?us-ascii?q?oFRhmOBYYIehScFoSCHXoxyDYJuiFyHO5VHgTmBZVMlFUmHH3QBiCoBAQE?= X-IronPort-AV: E=Sophos;i="5.42,444,1500955200"; d="scan'208";a="64937" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.35]) by goalie.tycho.ncsc.mil with ESMTP; 27 Sep 2017 04:17:12 -0400 Received: from ucol3cpa04.eemsg.mail.mil ([214.24.24.42]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 27 Sep 2017 08:17:12 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;49bfa7a2-6b08-4632-80ee-230e682e2760 Authentication-Results: UCOL3CPA05.eemsg.mail.mil; dkim=neutral (message not signed) header.i=none X-EEMSG-check-008: 238313509|UCOL3CPA05_EEMSG_MP20.csd.disa.mil X-EEMSG-check-001: false X-EEMSG-SBRS: 3.5 X-EEMSG-ORIG-IP: 209.132.183.28 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B/AADQW8tZhxy3hNFbHAEBBAEBCgEBgzEoAWZuJ44VdI8ImCGCEgojhRgChFY/GAECAQEBAQEBARMBAQEKCwkIKC+FGQMDgQlRV4h4gVIQqmyLAgELJoMrggKBUYZjgWGCHoUnBaEgh16Mcg2CbohchzuVR4E5H4FGUyUVSYUqgXU+NgGIKgEBAQ X-IPAS-Result: A0B/AADQW8tZhxy3hNFbHAEBBAEBCgEBgzEoAWZuJ44VdI8ImCGCEgojhRgChFY/GAECAQEBAQEBARMBAQEKCwkIKC+FGQMDgQlRV4h4gVIQqmyLAgELJoMrggKBUYZjgWGCHoUnBaEgh16Mcg2CbohchzuVR4E5H4FGUyUVSYUqgXU+NgGIKgEBAQ Received: from mx1.redhat.com ([209.132.183.28]) by UCOL3CPA05.eemsg.mail.mil with ESMTP; 27 Sep 2017 08:17:11 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47453C07F9A4 for ; Wed, 27 Sep 2017 08:17:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 47453C07F9A4 Received: from Thinkpad_450.redhat.com (unknown [10.40.205.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4DDE7EA3D for ; Wed, 27 Sep 2017 08:17:09 +0000 (UTC) X-EEMSG-check-009: 444-444 From: Vit Mojzis To: selinux@tycho.nsa.gov Date: Wed, 27 Sep 2017 10:16:45 +0200 Message-Id: <20170927081645.32481-3-vmojzis@redhat.com> In-Reply-To: <20170927081645.32481-1-vmojzis@redhat.com> References: <20170927081645.32481-1-vmojzis@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 27 Sep 2017 08:17:10 +0000 (UTC) Subject: [PATCH 2/2] python/semanage: Enable listing fcontexts.homedirs X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Include entries from fcontexts.homedirs when listing file contexts via "semanage fcontext -l" Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1409813 --- python/semanage/seobject.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py index 70fd192..cf64e25 100644 --- a/python/semanage/seobject.py +++ b/python/semanage/seobject.py @@ -2566,10 +2566,15 @@ class fcontextRecords(semanageRecords): if rc < 0: raise ValueError(_("Could not list file contexts")) + (rc, fchomedirs) = semanage_fcontext_list_homedirs(self.sh) + if rc < 0: + raise ValueError(_("Could not list local file contexts")) + (rc, fclocal) = semanage_fcontext_list_local(self.sh) if rc < 0: raise ValueError(_("Could not list local file contexts")) + self.flist += fchomedirs self.flist += fclocal ddict = {}