Re: Why is /usr/include matched with /usr/inclu.e?

Dominick Grift <[email protected]>
Newsgroups org.kernel.vger.selinux-refpolicy
Message-ID <[email protected]>
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 pattern matches /usr/include and its content, but why is a dot
> used? Which other directories can it match?
> 
> The issue there is that a dot can match a slash, so the pattern also
> matches /usr/inclu/e/, which seems strange. This pattern has been
> introduced in the very early days of refpolicy's git repository,
> according to https://github.com/SELinuxProject/refpolicy/commit/f8ec0ad43b54437e2d9f0e48a773a64dbd9e543c#diff-e333cb52d2139f7a71f0dfbd32c06f70R117.
> Does anyone remember why the pattern for /usr/include is so special?
> 
> Thanks,
> Nicolas
> 

-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift
signature.asc (application/pgp-signature, 659 B)
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCAAdFiEEujmXliIBLFTc2Y4AJXSOVTf5R2kFAl1do14ACgkQJXSOVTf5
R2nidwv/cBN7C5AWIILzwKm91F9nBujYgg1azcP17is3pLezip2eEPwx4ai0xrm0
dNdFBXGBSgJf3ANpuMaoG2kKtGOiDJZN+8MjVWcAOmO3VF+OS5fMVIHaGu80Uuoa
Hyfven+prmd+tjoudbl8u6PWZqfidIX20qS8NAwONzhWDs6IbiELZ9Yh95Pg9Oe0
ZFW2+fsM4EDQXfCQFXJYXxhNoK7Abw6gugNYBhfdamlU8ei35GSUeyDG/392RRBC
//si8WeIi0d0RcMx1MA5k3hSVI6XToli3yVhPXk+6iwPF7qEWWGGoFCPw3mDPB7G
Crt8X8k9N5oearQwJn27olgFYsApdDT65VUzSIfBadGwkTTWkGKftAP7qu9MQyc5
kZIaOl++I1ymWn/wK+Ydu2CRCpxAEynmzCMBkY5FDP19kDNSrQWkTomj2jieNwbU
5RLwKhzmuGaKB+yhVKyNDshTqq3sy6IeQt1GzqxCKQdEH1V5asRXeuHugG1BrX/D
oLfcAh7P
=3aiE
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.