From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18D45C3A5A3 for ; Tue, 27 Aug 2019 04:07:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0162206E0 for ; Tue, 27 Aug 2019 04:07:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="FfCRc7bt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725825AbfH0EHC (ORCPT ); Tue, 27 Aug 2019 00:07:02 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:41872 "EHLO mail-qt1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725805AbfH0EHC (ORCPT ); Tue, 27 Aug 2019 00:07:02 -0400 Received: by mail-qt1-f173.google.com with SMTP id i4so20072635qtj.8 for ; Mon, 26 Aug 2019 21:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5+WxKloMKU4hxoYdxI37/zDoSU8uPvaLtiHGXBX2n4Q=; b=FfCRc7btidmE037OkanIx96YBULfQRLXkZY3K8B9E/Xj/PobovoKGFouD/dWSkkls1 y/bfdyTM/WKz3cRPTo6SaM2UgTyswdRA6fFkzSlQDXkg4NLQ1rNhWsTf37DXsWwdMx75 0Zkt/JQR8v9lEQr4vl3pk0EbFfY0R8u8yht+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5+WxKloMKU4hxoYdxI37/zDoSU8uPvaLtiHGXBX2n4Q=; b=SyHQdJYpoWM7rrGbaki0hhhmxprJpK/8ZEn9oiG/9f6X4f3sx5AaLH85WyE2niG5sm PvK/YVVd+8eSIHnVorFFg246IRfY95+OoCak5DiKXMTQB9nBFzFiip0mFKL2fT8EXcSH 9sdH2uoUPWpnMAsa0mbXID5HFqa7Y0S/9mS6bSQ5bxIdx0xVg2QQbNXZkBNONb4ojs1P JghckOiT2dDouTQVYOuQGQV9ZGB7DqHzAi3LEQzd3i9VZI1EItOOMroYOlBHcnagi0Ao JoKNkQgNrDcY8cYHd8P2k+6suvyO0NQSTYanUqsrEtEXwMVqQzw7dKKQxvnhIaT6Vi2Y 77mw== X-Gm-Message-State: APjAAAWNEWWvgHuENrEp+G1FnmgtBP4seNxCSFflEaBSWoS9BW/g4VG4 n7n06yW5b6/yKd9kKfhaOwD2nXoyrCw= X-Google-Smtp-Source: APXvYqzjZAOrIVBuB0uDlAuRQ1DCKna0U72dQAB6UEXvgKUVpcMY6yhqlyTQkThx98zfwFJ5wAqldg== X-Received: by 2002:ad4:450c:: with SMTP id k12mr18563766qvu.1.1566878820200; Mon, 26 Aug 2019 21:07:00 -0700 (PDT) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id o34sm10601256qtc.61.2019.08.26.21.06.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Aug 2019 21:06:59 -0700 (PDT) Subject: Re: Why is /usr/include matched with /usr/inclu.e? To: Nicolas Iooss Cc: selinux-refpolicy@vger.kernel.org References: <20190821200243.GA5262@brutus.lan> From: Chris PeBenito Message-ID: Date: Tue, 27 Aug 2019 00:06:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 8/21/19 4:29 PM, Nicolas Iooss wrote: > On Wed, Aug 21, 2019 at 10:02 PM Dominick Grift wrote: >> >> On Wed, Aug 21, 2019 at 09:57:14PM +0200, Nicolas Iooss wrote: >>> Hi all, >>> >>> While checking the patterns in refpolicy, I stumbled upon the >>> following line in >>> https://github.com/SELinuxProject/refpolicy/blob/RELEASE_2_20190609/policy/modules/kernel/files.fc#L200 >>> >>> /usr/inclu.e(/.*)? gen_context(system_u:object_r:usr_t,s0) >> >> Probably to work around an m4-ism. There seems to be an m4 "include" built-in. > > This seems to be a good explanation. The policy also uses workarounds > for "index" built-in, with: > > /etc/amanda/.*/index`'(/.*)? > /var/lib/apt-xapian-inde(x)(/.*)? > > In order not to introduce parentheses (which might change some > ordering in the way the paths are matched with the patterns), I am > thinking of replacing the pattern of /usr/include with: > > /usr/includ[e](/.*)? gen_context(system_u:object_r:usr_t,s0) > > ... with a comment about working around a m4 issue. My preference would be an empty m4 string (`') over some regex trick, if possible, so the sorting isn't upset. -- Chris PeBenito