tests: show error line in sbin check.
This commit is contained in:
parent
6ed873aad3
commit
f0355f36b9
1 changed files with 3 additions and 3 deletions
|
|
@ -338,7 +338,7 @@ check_sbin() {
|
||||||
jobs=0
|
jobs=0
|
||||||
for name in "${sbin[@]}"; do
|
for name in "${sbin[@]}"; do
|
||||||
(
|
(
|
||||||
mapfile -t files < <(grep --files-with-matches --recursive -E "(^|[[:space:]])@{bin}/$name([[:space:]]|$)" apparmor.d)
|
mapfile -t files < <(grep --line-number --recursive -E "(^|[[:space:]])@{bin}/$name([[:space:]]|$)" apparmor.d | cut -d: -f1,2)
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
_err compatibility "$file" "contains '@{bin}/$name' instead of '@{sbin}/$name'"
|
_err compatibility "$file" "contains '@{bin}/$name' instead of '@{sbin}/$name'"
|
||||||
done
|
done
|
||||||
|
|
@ -349,7 +349,7 @@ check_sbin() {
|
||||||
|
|
||||||
local pattern='[[:alnum:]_.-]+' # Pattern for valid file names
|
local pattern='[[:alnum:]_.-]+' # Pattern for valid file names
|
||||||
jobs=0
|
jobs=0
|
||||||
mapfile -t files < <(grep --files-with-matches --recursive -E "(^|[[:space:]])@{sbin}/$pattern([[:space:]]|$)" apparmor.d)
|
mapfile -t files < <(grep --line-number --recursive -E "(^|[[:space:]])@{sbin}/$pattern([[:space:]]|$)" apparmor.d | cut -d: -f1,2)
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
(
|
(
|
||||||
while read -r match; do
|
while read -r match; do
|
||||||
|
|
@ -359,7 +359,7 @@ check_sbin() {
|
||||||
_err compatibility "$file" "contains '@{sbin}/$name' but it is not in sbin.list"
|
_err compatibility "$file" "contains '@{sbin}/$name' but it is not in sbin.list"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < <(grep --only-matching -E "@\{sbin\}/$pattern" "$file")
|
done < <(grep --only-matching -E "@\{sbin\}/$pattern" "${file%%:*}")
|
||||||
) &
|
) &
|
||||||
_wait jobs
|
_wait jobs
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue