From c2f40dcd3f5b0a5c40354064a79d439345c8e117 Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan Date: Tue, 10 Aug 2010 11:15:17 +0000 Subject: [PATCH] - Fixes to the chkportsum script to handle better some special cases, like spaces in filename Submitted by: Alex Kozlov Approved by: delphij (mentor) --- etc/periodic/security/460.chkportsum | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/periodic/security/460.chkportsum b/etc/periodic/security/460.chkportsum index be11684a8374..3a39c84d0835 100644 --- a/etc/periodic/security/460.chkportsum +++ b/etc/periodic/security/460.chkportsum @@ -42,20 +42,20 @@ echo 'Checking for ports with mismatched checksums:' case "${daily_status_security_chkportsum_enable}" in [Yy][Ee][Ss]) + set -f pkg_info -ga 2>/dev/null | \ - while read one two three; do - case ${one} in + while IFS= read -r line; do + set -- $line + case $1 in Information) - case ${two} in - for) name=${three%%:} ;; - *) name='??' ;; + case $2 in + for) name="${3%%:}" ;; + *) name='??' ;; esac ;; Mismatched|'') ;; - *) - if [ -n ${name} ]; then - echo ${name}: ${one} - fi + *) [ -n "${name}" ] && + echo "${name}: ${line%% fails the original MD5 checksum}" ;; esac done