mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-10-01 08:25:45 -04:00
fix checking existing entries to avoid needless calls to dpkg-statoverride
This commit is contained in:
parent
370f3c5e54
commit
b3458cc6ee
@ -198,10 +198,17 @@ set_file_perms() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mode_for_grep="$mode_from_config"
|
||||||
|
first_character_of_mode_from_config="${mode_from_config::1}"
|
||||||
|
if [ "$first_character_of_mode_from_config" = "0" ]; then
|
||||||
|
## Remove leading '0'.
|
||||||
|
mode_for_grep="${mode_from_config:1}"
|
||||||
|
fi
|
||||||
|
|
||||||
## Check there is an entry for the fso.
|
## Check there is an entry for the fso.
|
||||||
if dpkg-statoverride --list | grep -q "$fso_without_trailing_slash"; then
|
if dpkg-statoverride --list | grep -q "$fso_without_trailing_slash"; then
|
||||||
## There is an fso entry. Check if owner/group/mode match.
|
## There is an fso entry. Check if owner/group/mode match.
|
||||||
if dpkg-statoverride --list | grep -q "$owner $group $mode_from_config $fso_without_trailing_slash"; then
|
if dpkg-statoverride --list | grep -q "$owner $group $mode_for_grep $fso_without_trailing_slash"; then
|
||||||
## The owner/group/mode matches. No further action required.
|
## The owner/group/mode matches. No further action required.
|
||||||
true OK
|
true OK
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user