tags 418147 patch thanks Hello,
attached is a patch to fix this issue. Please include it. It also removes the old check which was never triggered. Regards Simon -- + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x1972F726F0D556E7
--- /tmp/logcheck.orig 2015-11-16 10:51:24.697748301 +0100
+++ /usr/sbin/logcheck 2015-11-16 10:54:37.094323732 +0100
@@ -215,18 +215,21 @@
mkdir "$cleaned" \
|| error "Could not make dir $cleaned for cleaned rulefiles."
fi
+ # run-parts doesn't include files which are not readable. Use this
+ # separate check to correctly report unreadable files.
+ for x in "$dir"/*; do
+ if [ -f "$x" ] && [ ! -r "$x" ]; then
+ error "Couldn't read $x"
+ fi
+ done
for rulefile in $(run-parts --list "$dir"); do
rulefile="$(basename "$rulefile")"
if [ -f "${dir}/${rulefile}" ]; then
debug "cleanrules: ${dir}/${rulefile}"
- if [ -r "${dir}/${rulefile}" ]; then
- # pipe to cat on greps to get usable exit status
- egrep --text -v '^[[:space:]]*$|^#' "$dir/$rulefile" | cat \
- >> "$cleaned/$rulefile" \
- || error "Couldn't append to $cleaned/$rulefile."
- else
- error "Couldn't read $dir/$rulefile"
- fi
+ # pipe to cat on greps to get usable exit status
+ egrep --text -v '^[[:space:]]*$|^#' "$dir/$rulefile" | cat \
+ >> "$cleaned/$rulefile" \
+ || error "Couldn't append to $cleaned/$rulefile."
fi
done
elif [ -f "$dir" ]; then
signature.asc
Description: Digital signature
_______________________________________________ Logcheck-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/logcheck-devel

