From patchwork Thu Sep 15 17:53:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Smalley X-Patchwork-Id: 9334487 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 9E51D6077F for ; Thu, 15 Sep 2016 17:55:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 960BB29AD9 for ; Thu, 15 Sep 2016 17:55:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 871C429ADF; Thu, 15 Sep 2016 17:55:44 +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 A506D29AD9 for ; Thu, 15 Sep 2016 17:55:43 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,340,1470700800"; d="scan'208,223";a="17632965" IronPort-PHdr: =?us-ascii?q?9a23=3AS5WaXxfqcyL1FDqVkvFexJ8FlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc+ybR7h7PlgxGXEQZ/co6odzbGH6ua/BCdZuM3J8ChbNscdD1ld0Y?= =?us-ascii?q?RetjdjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9?= =?us-ascii?q?fbytScbshsi6n9q/54fUK10RwmHsOPUtcV7v9F6Z9pFPx9AzcuBpklqBi0ALUt?= =?us-ascii?q?we/XlvK1OXkkS0zeaL17knzR5tvek8/dVLS6TwcvdwZ7VZCDM7LzJ9v5Wz5lHr?= =?us-ascii?q?BDGC7XoEU2gQjgEAQ02ctEm7DarrtmPGksY1mGzAZYylBYwzDBar6aZwADPhji?= =?us-ascii?q?YcOiAi82DMwphygKtdoQmJrhpz2YnVbMeeM/8oOuvGcNcbQ3dRdtpAXCxGRIWn?= =?us-ascii?q?Zs0ACPRFdf1Vpo/xvVwPoV66BBKwLP/+wT9PwHnt1Os11PplWQPZ1wU6A4gmrG?= =?us-ascii?q?XfrNKzMrwbF++y0vrm1zLGOshK1C/95Y6ASRUopfWBTPokasbK4VU+HAPCyFOL?= =?us-ascii?q?oMrqOC3DhbdFiHSS8+c1DbHnsGUgsQwk52H1nso=3D?= X-IPAS-Result: =?us-ascii?q?A2FhAwBW39pX/wHyM5BcGwEBBAEBCgEBGAEFAQsBgxABAQE?= =?us-ascii?q?BAR6BAVKjLAaWTgVQBB6GBYFeTAEBAQEBAQEBAgECWyeCMgQBFQEEghABAQEBA?= =?us-ascii?q?wECICsgDgMJAQEKDQEDAQIBAgEmBAICAwEtFQMGCAYBBwUGAgEBARgEiCm1W4w?= =?us-ascii?q?8AQsBFg6FaYJBglaEEAIRATwMglaCWgWZaINAjBmJeoVrjF6De1QghGNUhFMPF?= =?us-ascii?q?0iBQAEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 15 Sep 2016 17:55:41 +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 u8FHrWFf011255; Thu, 15 Sep 2016 13:53:33 -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 u8FHoVlp267220 for ; Thu, 15 Sep 2016 13:50:31 -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 u8FHoUvF011090; Thu, 15 Sep 2016 13:50:30 -0400 Subject: Re: [PATCH] libselinux: add support for pcre2 To: Janis Danisevskis , selinux@tycho.nsa.gov, seandroid-list@tycho.nsa.gov, jwcart2@tycho.nsa.gov References: <1473956073-46046-1-git-send-email-jdanis@android.com> From: Stephen Smalley Organization: National Security Agency Message-ID: <15b4d3b8-bd87-849a-1df5-b236a435c768@tycho.nsa.gov> Date: Thu, 15 Sep 2016 13:53:03 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1473956073-46046-1-git-send-email-jdanis@android.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: Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP On 09/15/2016 12:14 PM, Janis Danisevskis wrote: > From: Janis Danisevskis > > This patch moves all pcre1/2 dependencies into the new files regex.h > and regex.c implementing the common denominator of features needed > by libselinux. The compiler flag -DUSE_PCRE2 toggles between the > used implementations. > > As of this patch libselinux supports either pcre or pcre2 but not > both at the same time. The persistently stored file contexts > information differs. This means libselinux can only load file > context files generated by sefcontext_compile build with the > same pcre variant. > > Also, for pcre2 the persistent format is architecture dependent. > Stored precompiled regular expressions can only be used on the > same architecture they were generated on. If pcre2 is used, > sefcontext_compile now respects the "-r". This flag makes > sefcontext_compile include the precompiled regular expressions > in the output file. The default is to omit them, so that the > output remains portable at the cost of having to recompile > the regular expressions at load time, or rather on first use. > > Signed-off-by: Janis Danisevskis Thanks, applied, with the attached fix on top to allow building. From a9162c813adaadbdb632d1a71d7c6ffc3e43b1b0 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Thu, 15 Sep 2016 13:43:24 -0400 Subject: [PATCH] libselinux: regex_writef: Mark unused argument with __attribute__((unused)). Signed-off-by: Stephen Smalley --- libselinux/src/regex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libselinux/src/regex.c b/libselinux/src/regex.c index 646351b..750088e 100644 --- a/libselinux/src/regex.c +++ b/libselinux/src/regex.c @@ -312,7 +312,8 @@ static inline pcre_extra *get_pcre_extra(struct regex_data *regex) } } -int regex_writef(struct regex_data *regex, FILE *fp, int unused) +int regex_writef(struct regex_data *regex, FILE *fp, + int unused __attribute__((unused))) { int rc; size_t len; -- 2.7.4