ports/security/rkhunter/files/patch-files_rkhunter
Stefan Eßer 9410ef41ae security/rkhunter: use sha256 instead of sha256sum
Coreutils compatible versions of the hash commands have been added
to 14-CURRENT and 13-STABLE. These were preferred by rkhunter, when
found, but without adjustment of the position of the hash in the
generated output.

Instead of trying to adjust for different positions of the hash,
this patch removes the preference for sha256sum over sha256 and
restores the behavior this script had before sha256sum has been
made available in recent FreeBSD versions.

Tested by:	Łukasz Wąsikowski (maintainer)
2021-07-17 23:17:14 +02:00

35 lines
1.1 KiB
Text

--- files/rkhunter.orig 2018-02-24 23:08:27 UTC
+++ files/rkhunter
@@ -4750,7 +4750,12 @@ get_sha_hash_function() {
return
fi
- HFUNC=`find_cmd sha${SHA_SIZE}sum`
+ case ${OPERATING_SYSTEM} in
+ FreeBSD)
+ HFUNC=`find_cmd sha${SHA_SIZE}` ;;
+ *)
+ HFUNC=`find_cmd sha${SHA_SIZE}sum` ;;
+ esac
if [ -z "${HFUNC}" ]; then
HFUNC=`find_cmd sha${SHA_SIZE}`
@@ -7522,6 +7527,9 @@ download_file() {
rm -f "${OUTPUT_FILE}" >/dev/null 2>&1
case "${RKHWEBCMD_BASE}" in
+ fetch)
+ CMD="${RKHWEBCMD} ${RKHWEBCMD_OPTS} -q -o \"${OUTPUT_FILE}\" ${MIRROR}${URL} 2>/dev/null"
+ ;;
wget)
CMD="${RKHWEBCMD} ${RKHWEBCMD_OPTS} -q -O \"${OUTPUT_FILE}\" ${MIRROR}${URL} 2>/dev/null"
;;
@@ -18557,7 +18560,7 @@ REQCMDS="awk cat chmod chown cp cut date egrep grep he
# List of commands used to download files from the web. This list is
# used by the '--update' and '--versioncheck' options. Preferred commands
# are listed first. This can be overridden by the config file.
-WEBCMDLIST="wget curl elinks links lynx bget GET"
+WEBCMDLIST="fetch wget curl elinks links lynx bget GET"
RKHWEBCMD=""
RKHWEBCMD_OPTS=""