Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5023005ybl; Mon, 26 Aug 2019 21:07:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn/B2V//sgboBQq3aBEr6yh7dDbY5ijfvegvUn3Gp3WE2KXMRb2xkPYvc2xL2wTIIIzJK5 X-Received: by 2002:a17:90a:86c2:: with SMTP id y2mr23700483pjv.46.1566878826097; Mon, 26 Aug 2019 21:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566878826; cv=none; d=google.com; s=arc-20160816; b=DU1X9hXobgAcR4cBjEdIud07YFb3FzOu0JMYai3fH0j2UsahmMtTJXL3rV+v3ka/J6 AoVOWwRdWRKvsuwZrYSNUbiriwVkNX+7Jj/mHL1j3KoVypwqeduJeYa8vaEXCs7a8utN m5ux/lWEIXyHvuo8W6pX68r5B1kcmz79IkdOlL2Q9kaTNoAEllLNA/gnGYkYkYtLWkF8 XimAmmy4HtMollUP7e0b79dI373KWRcJ7E2945xIdGyVbob3e1eopZOaIEDioFwOHtOF FoBUkvWp2zWEjGAGppEwGowsq88UoafbayAyS1tgw3W7q8AAc1MMl3CmKEAD3lbEsYb8 tmbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=5+WxKloMKU4hxoYdxI37/zDoSU8uPvaLtiHGXBX2n4Q=; b=LtMX/oe9Avhgz/5LZ4Dj58AoNpfgtuF+6dZf7sILj+C73HcUCzMlmCsYEg8ZlNkiIt V1zliKnWbPqIbOvhOWVAuBtblO764+FWbJedZKa9sDtFyOWbq/IDLYx0Q8zY0/hfUBIg fyW96lm9TRMOdh8Xn4Sdd+6g+Ol5y5CJ7P4Bf2P5yiooGasIADgaKjebKopn+5RZSf37 LcZcjp1okgBBNKz8ZaveUt3ZWtu9P5w3qNsWUakiJSU6YZHYMliRghULgfSxXN9vW7p3 OH9tp+2HZRtgPOlLvzlJ5FulDNPSLlFTcl/tsxwlDMFn1ypkTYvPESUL0BkTLEdebNJ9 BNtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=FfCRc7bt; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si10989680pgh.262.2019.08.26.21.07.04; Mon, 26 Aug 2019 21:07:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=FfCRc7bt; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725825AbfH0EHC (ORCPT + 11 others); 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-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