mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-26 07:55:28 +03:00
fix(dracut-functions): avoid calling grep with PCRE (-P)
Invoking grep in Perl mode requires JIT'ing the Perl regex. This can run into issues with SELinix policy which will generally try to limit use of execmem in general purpose scripts. This occurs since the JIT'd code will live in executable memory. The PCRE only '\K' command in the Perl REGEX can be replaced by a call to awk instead.
This commit is contained in:
parent
260883d96f
commit
67591e8855
@ -244,7 +244,7 @@ get_maj_min() {
|
||||
local _out
|
||||
|
||||
if [[ $get_maj_min_cache_file ]]; then
|
||||
_out="$(grep -m1 -oP "^$1 \K\S+$" "$get_maj_min_cache_file")"
|
||||
_out="$(grep -m1 -oE "^$1 \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')"
|
||||
fi
|
||||
|
||||
if ! [[ "$_out" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user