test that wc is functional

https://github.com/Kicksecure/security-misc/pull/305#issuecomment-2892378246
This commit is contained in:
Patrick Schleizer 2025-05-21 07:20:13 -04:00
parent 5930e27052
commit 353b6e83c5
No known key found for this signature in database
GPG key ID: CB8D50BB77BB3C48
2 changed files with 20 additions and 0 deletions

View file

@ -7,5 +7,15 @@ set -x
set -e set -e
set -o pipefail set -o pipefail
if ! printf '%s\n' | wc -l >/dev/null ; then
printf "\
$0: ERROR: command 'wc' test failed! Do not ignore this!
'wc' can core dump. Example:
zsh: illegal hardware instruction (core dumped) wc -l
https://github.com/rspamd/rspamd/issues/5137" >&2
exit 1
fi
wc -L "/var/lib/apt/lists/"*InRelease wc -L "/var/lib/apt/lists/"*InRelease
wc -L "/var/lib/apt/lists/"*InRelease | awk '$1 > 1024 {print; exit 1}' wc -L "/var/lib/apt/lists/"*InRelease | awk '$1 > 1024 {print; exit 1}'

View file

@ -35,6 +35,16 @@ ERROR: Please report this bug." >&2
trap error_handler ERR trap error_handler ERR
if ! printf '%s\n' | wc -l >/dev/null ; then
printf "\
$0: ERROR: command 'wc' test failed! Do not ignore this!
'wc' can core dump. Example:
zsh: illegal hardware instruction (core dumped) wc -l
https://github.com/rspamd/rspamd/issues/5137" >&2
exit 1
fi
## Named constants. ## Named constants.
pam_faillock_state_dir="/var/lib/security-misc/faillock" pam_faillock_state_dir="/var/lib/security-misc/faillock"