Skip to content

Commit

Permalink
libselinux: restore previous regex spec ordering
Browse files Browse the repository at this point in the history
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 <[email protected]>
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 <[email protected]>
Acked-by: James Carter <[email protected]>
  • Loading branch information
cgzones authored and jwcart2 committed Dec 17, 2024
1 parent 53078bb commit 08e0a34
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 187 deletions.
Loading

0 comments on commit 08e0a34

Please sign in to comment.