Package: tiger Version: 1:3.2.2-11 Severity: normal Tags: patch -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
If a file or files under /lost+found or /*/lost+found contain spaces in their name, tigercron will generate error messages in the mail. # touch /lost+found/"Which tiger script complains?" - -- wait; mail will arrive as such: From: r...@example.com (Cron Daemon) To: r...@example.com Subject: Cron <r...@mongo> test -x /usr/sbin/tigercron && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; nice -n$NICETIGER /usr/sbin/tigercron -q ; } Content-Type: text/plain; charset=ANSI_X3.4-1968 /bin/ls: cannot access Which: No such file or directory /bin/ls: cannot access tiger: No such file or directory /bin/ls: cannot access script: No such file or directory /bin/ls: cannot access complains?: No such file or directory While debugging this I tracked the problem to the check_known script, and further found conditions which could generate "arg list too long" situations. The attached patch attempts to correct both of these problems, and additionally addresses a TODO: noted in that area of the code. This fix is not bulletproof in the face of, for example, filenames containing newlines, but those are thankfully rare and this is an improvement in the more common case of spaces. The expressions used also add recognition of ReiserFS-style fsck filenames (nnnn_nnnn) to the more common (#nnnn) type, but not in the case of HP-UX as presumably it lacks Reiser support. In any event, I lack a system on which to test that code. Best regards, Dave - -- System Information: Debian Release: squeeze/sid Architecture: i386 (i686) Kernel: Linux 2.6.29.4 (PREEMPT) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash Versions of packages tiger depends on: ii binutils 2.19.1-1 The GNU assembler, linker and bina ii bsdmainutils 6.1.10 collection of more utilities from ii debconf [debconf-2.0] 1.5.26 Debian configuration management sy ii diff 2.8.1-13 File comparison utilities ii libc6 2.9-13 GNU C Library: Shared libraries ii net-tools 1.60-23 The NET-3 networking toolkit ii ucf 3.0018 Update Configuration File: preserv Versions of packages tiger recommends: ii chkrootkit 0.48-10 rootkit detector ii exim4-daemon-light [mail-tran 4.69-11 lightweight Exim MTA (v4) daemon pn john <none> (no description available) Versions of packages tiger suggests: ii lsof 4.81.dfsg.1-1 List open files - -- debconf-show failed - -- debsums errors found: debsums: checksum mismatch tiger file /usr/lib/tiger/scripts/check_known -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkoxoB4ACgkQnN+41NpzKveIPwCffc7UAqT8j/GhNb9KWhsHZHhD l6sAnRs9WGs6ajXd61RhqZsxU/yVt+mv =Vkga -----END PGP SIGNATURE-----
--- usr/lib/tiger/scripts/check_known.orig 2009-06-09 18:42:10.000000000 -0400 +++ usr/lib/tiger/scripts/check_known 2009-06-11 11:05:37.000000000 -0400 @@ -186,7 +186,7 @@ done } - haveallcmds GET_MOUNTS AWK FIND SED TR && { + haveallcmds GET_MOUNTS AWK FIND SED && { $GET_MOUNTS local | $AWK '{ if($1 == "/") @@ -198,23 +198,27 @@ do [ -d "$dir" -a -r "$dir" ] && { cd "$dir" - files=`$FIND . -print | $SED -e 's%^./%%' -e '/^.$/d' -e '/^..$/d'` + alertfiles="`$FIND . -name . -fprintf /dev/null '' -o \( -name '#[0-9]*' -o -name '[0-9]*_[0-9]*' \) -prune -o -print | $SED 's%^./%%'`" # On HP-UX change to: - #files=`$FIND . -print | $SED -e 's%^./%%' -e '/^.$/d' -e '/^..$/d' -e '/^[.]fsadm$/d'` - alertfiles=`echo "$files" | - $TR ' ' '\012' | - $SED -e 's%^#\{1\}[0-9][0-9.]*$%%g' - ` + #alertfiles="`$FIND . \( -name . -o -name .fsadm \) -fprintf /dev/null '' -o -name '#[0-9]*' -prune -o -print | $SED 's%^./%%'`" if [ -n "$alertfiles" ]; then message WARN kis004w "" "$dir contains possible non-fsck files:" - # TODO: Consider not listing the files and just providing - # the raw numbers if the number of non-fsck files is very high. - for file in $alertfiles ; do - $LS -alR $file - done + # If there are very many non-fsck files, don't list them + # and just provide the raw count. + filecount=$(( `echo "$alertfiles" | wc -l` )) + if [ $filecount -lt 500 ]; then + echo "$alertfiles" | while read file; do + $LS -ld "$file" + done + else + echo "(${filecount} files)" + fi echo - elif [ -n "$files" ]; then - message WARN kis004w "Files: $alertfiles" "$dir is not empty:" + else + filecount=$(( `$LS -a | wc -l` )) + if [ $filecount -gt 2 ]; then + message WARN kis004w "Files: ${filecount} file(s)" "$dir is not empty:" + fi fi } done