selinux/libselinux/utils
Christian Göttsche 08e0a3489b libselinux: restore previous regex spec ordering
Prior the recent selabel_file(5) rework regular expressions for a
certain stem where matched in the order given by the input.
The Reference and Fedora Policy as well as CIL and libsemanage pre-sort
the file context definitions based on the prefix stem length, so this
ordering was adopted.

Do not alter the order by the input of regex specifications, and search
on matches on regex specifications in in parent nodes, which might
contain specifications with definitions defined later in the source
file.
This restores backward compatibility, especially for Android.

Reported-by: Takaya Saeki <takayas@chromium.org>
Closes: https://lore.kernel.org/selinux/CAH9xa6eFO6BNeGko90bsq8CuDba9eO+qdDoF+7zfyAUHEDpH9g@mail.gmail.com/
Fixes: 92306da ("libselinux: rework selabel_file(5) database")
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
2024-12-17 14:58:28 -05:00
..
.gitignore libselinux/utils: introduce selabel_compare 2024-11-15 13:27:14 -05:00
avcstat.c libselinux: avcstat: use standard length modifier for unsigned long long 2021-05-18 10:06:22 +02:00
compute_av.c libselinux/utils: improve compute_av output 2024-01-25 12:51:06 -05:00
compute_create.c libselinux: support objname in compute_create 2022-10-13 11:23:41 -04:00
compute_member.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
compute_relabel.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
getconlist.c libselinux/utils: free allocated resources 2024-01-25 12:51:04 -05:00
getdefaultcon.c libselinux/utils: free allocated resources 2024-01-25 12:51:04 -05:00
getenforce.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
getfilecon.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
getpidcon.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
getpidprevcon.c libselinux: add getpidprevcon 2023-02-10 22:23:11 -08:00
getpolicyload.c libselinux/utils: introduce getpolicyload 2023-08-04 13:55:55 -04:00
getsebool.c libselinux: getsebool: always free names 2017-04-12 14:46:02 -04:00
getseuser.c libselinux/utils/getseuser.c: fix build with gcc 4.8 2021-07-03 16:00:38 +02:00
Makefile Always build for LFS mode on 32-bit archs. 2024-12-17 14:53:39 -05:00
matchpathcon.c libselinux: silence -Wextra-semi-stmt warning 2021-07-06 11:08:11 -04:00
policyvers.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
sefcontext_compile.c libselinux: restore previous regex spec ordering 2024-12-17 14:58:28 -05:00
selabel_compare.c libselinux/utils: introduce selabel_compare 2024-11-15 13:27:14 -05:00
selabel_digest.c libselinux/utils/selabel_digest: pass BASEONLY only for file backend 2024-03-20 14:17:34 -04:00
selabel_get_digests_all_partial_matches.c libselinux/utils: drop include of internal header file 2023-10-11 15:07:37 -04:00
selabel_lookup_best_match.c libselinux: simplify string copying 2022-11-21 14:29:21 -05:00
selabel_lookup.c libselinux/utils: use correct type for backend argument 2023-10-11 15:01:15 -04:00
selabel_partial_match.c libselinux/utils: update selabel_partial_match 2023-10-11 14:57:17 -04:00
selinux_check_access.c libselinux/utils: use type safe union assignment 2023-10-11 15:00:16 -04:00
selinux_check_securetty_context.c libselinux: include errno.h instead of sys/errno.h 2017-01-09 16:00:22 -05:00
selinuxenabled.c initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
selinuxexeccon.c libselinux/utils: free allocated resources 2024-01-25 12:51:04 -05:00
setenforce.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
setfilecon.c libselinux/utils: print errno on failure 2022-05-16 10:31:15 -04:00
togglesebool.c libselinux/utils: fix all the noreturn errors 2016-11-01 17:29:49 -04:00
validatetrans.c libselinux/utils: check for valid contexts to improve error causes 2022-04-12 13:09:27 -04:00