[Logcheck-devel] Bug#616103: (re)enable globbing of logfile names

Progfou jean-christophe.andre at auf.org
Tue Apr 26 18:25:22 UTC 2011


Package: logcheck
Version: 1.3.13
Severity: normal

	Hi there!

I second the need for this correction.

I would even propose to set the severity higher, since the lack of
globbing support just make this package useless in this specific case.


Martin wrote:
> You can/should use /bin/sh and print instead.
>   xargs -I{} sh -c "print {}"

I suppose you meant "printf" or "echo", instead of "print" which is
not a builtin with "dash" (so it launch the external "print" command).

But in fact it seems better to use "ls", since "printf" or "echo" would
list the resulting files separated by spaces, so we then would have to
split them by spaces and loose on the “space in file name” case.

I would suggest this one instead:

  xargs -I{} /bin/sh -c "/bin/ls -1 {}"

I've tested this on my system and it gives the expected result.


If we ever decided to not care about spaces in file names (after all,
they are computer generated and so are predictable) we could use the
simpler patch I've attached here.

Cheers, J.C.

-- System Information:
Debian Release: 6.0.1
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-openvz-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
--- /usr/sbin/logcheck.orig	2010-09-03 15:25:15.000000000 +0700
+++ /usr/sbin/logcheck	2011-04-27 00:26:05.000000000 +0700
@@ -659,7 +659,7 @@
     || error "Could not mkdir for log files"
 if [ ! "$LOGFILE" ] && [ -r "$LOGFILES_LIST" ]; then
     egrep --text -v "(^#|^[[:space:]]*$)" "$LOGFILES_LIST" | while read file; do
-	logoutput "$file"
+	for f in $file ; do logoutput "$f" ; done
     done
 elif [ "$LOGFILE" ]; then
     if [ -f "$LOGFILE" ] && [ -r "$LOGFILE" ]; then


More information about the Logcheck-devel mailing list