From patchwork Wed Dec 12 15:28:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 10726551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D2FC16B1 for ; Wed, 12 Dec 2018 15:28:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CEE32B148 for ; Wed, 12 Dec 2018 15:28:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 614982B164; Wed, 12 Dec 2018 15:28:35 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B0FD2B148 for ; Wed, 12 Dec 2018 15:28:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727706AbeLLP2e (ORCPT ); Wed, 12 Dec 2018 10:28:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727676AbeLLP2e (ORCPT ); Wed, 12 Dec 2018 10:28:34 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 944123084218 for ; Wed, 12 Dec 2018 15:28:34 +0000 (UTC) Received: from workstation.brq.redhat.com (unknown [10.43.12.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id E09845D70A; Wed, 12 Dec 2018 15:28:33 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach Subject: [PATCH] python/sepolicy: search() also for dontaudit rules Date: Wed, 12 Dec 2018 16:28:26 +0100 Message-Id: <20181212152826.24140-1-plautrba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 12 Dec 2018 15:28:34 +0000 (UTC) Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dontaudit rules were accidentally dropped during rewrite to SETools 4 API in 97d5f6a2 Fixes: >>> import sepolicy >>> sepolicy.search(['dontaudit']) [] Signed-off-by: Petr Lautrbach Acked-by: Nicolas Iooss --- Same patch as https://lore.kernel.org/selinux/20180918134401.22956-1-plautrba@redhat.com/ but with a slightly reworded commit message python/sepolicy/sepolicy/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/sepolicy/sepolicy/__init__.py b/python/sepolicy/sepolicy/__init__.py index cd7af7cf..fbeb731d 100644 --- a/python/sepolicy/sepolicy/__init__.py +++ b/python/sepolicy/sepolicy/__init__.py @@ -344,6 +344,8 @@ def search(types, seinfo=None): tertypes.append(NEVERALLOW) if AUDITALLOW in types: tertypes.append(AUDITALLOW) + if DONTAUDIT in types: + tertypes.append(DONTAUDIT) if len(tertypes) > 0: q = setools.TERuleQuery(_pol,