Package: tiger
Version: 1:3.2.3-6periapt6
Severity: wishlist
Tags: upstream patch


It would be nice if you could set the Tiger_FSScan_PruneDirs
parameter as a pipe-separated list of directories to be pruned from
the find command. A suggested patch will be attached.

-- System Information:
Debian Release: 6.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tiger depends on:
ii  binutils                   2.20.1-15     The GNU assembler, linker and bina
ii  bsdmainutils               8.2.1         collection of more utilities from 
ii  debconf [debconf-2.0]      1.5.38        Debian configuration management sy
ii  libc6                      2.11.2-9      Embedded GNU C Library: Shared lib
ii  lsof                       4.81.dfsg.1-1 List open files
ii  net-tools                  1.60-23       The NET-3 networking toolkit
ii  ucf                        3.0025+nmu1   Update Configuration File: preserv

Versions of packages tiger recommends:
ii  chkrootkit                    0.49-4     rootkit detector
ii  exim4-daemon-heavy [mail-tran 4.72-3+b1  Exim MTA (v4) daemon with extended
ii  john                          1.7.3.1-1  active password cracking tool

tiger suggests no packages.

-- Configuration Files:
/etc/cron.d/tiger changed [not included]

-- debconf information:
* tiger/mail_rcpt: root
* tiger/policy_adapt:
Author: Nicholas Bamber <nicho...@periapt.co.uk>
Subject: allow certain directories to be pruned from search
Last-Update: 2011-01-22
--- a/scripts/find_files
+++ b/scripts/find_files
@@ -17,6 +17,7 @@
 #
 # find_files - 06/14/93
 #
+# 22/01/2011 npb Add FINDPRUNE support
 # 02/26/2010 fgclaramonte  Properly remove the temporary mountlist file
 #                generated by the script
 #
@@ -42,17 +43,6 @@
 #              some new filename patterns to search for.
 #
 #-----------------------------------------------------------------------------
-# TODO:
-# - There is not currently a way for admins to have find _not_ go through
-#   directories that might be too big or should not be reviewed, consider
-#   using the -prune option (in combination with the defined FINEPRUNEOPT
-#   in configuration) like this:
-#   -a \! -name NAME -prune -a \! -name "*REGEXP*" -prune
-#
-# - Alternative, allow the admin to restrict the depth of the test using
-#   -maxdepth
-#
-#-----------------------------------------------------------------------------
 #
 TigerInstallDir='.'
 
@@ -269,19 +259,29 @@
 rw=rw
 [ "x$Tiger_FSScan_ReadOnly" = 'xY' ] && rw=
 
+if [ -n "$Tiger_FSScan_PruneDirs" ]; then
+    saveifs="$IFS"
+    IFS='|'
+    for p in $Tiger_FSScan_PruneDirs
+    do
+        FINDPRUNE="$FINDPRUNE --path $p --prune "
+    done
+    IFS="$saveifs"
+fi
+
 {
   if [ ! -n "$FINDXDEV" ]; then
     echo "$FINDPRUNE"
     echo "/"
   elif haveallcmds GETDISKS; then
-    echo "$FINDXDEV"
+    echo "$FINDXDEV $FINDPRUNE"
     $GETDISKS
   elif haveallcmds GET_MOUNTS; then
     #
     # This will do each file system in series... slower,
     # but better than banging the heads around.
     #
-    echo "$FINDXDEV"
+    echo "$FINDXDEV $FINDPRUNE"
     echo "`$GET_MOUNTS local all`"
   else
     echo "$FINDPRUNE"
@@ -303,7 +303,7 @@
       # Do not change these variable names
       otherfile="${outfile}.other.$counter"    
 
-#     echo "$FIND x $findpruneopt $findopt -print" 1>&2
+     echo "$FIND x $findpruneopt $findopt -print" 1>&2
       for mountpt in $disklist
       do
         # Not sure why we're cd'ing to /, but it breaks all relative paths
--- a/tigerrc
+++ b/tigerrc
@@ -312,6 +312,7 @@
 Tiger_FSScan_WarnUnknown=Y     # Warn about unknown filesystems used
 Tiger_FSScan_Local=''          # Filesystems considered to be local to the 
system, pipe-separated
 Tiger_FSScan_NonLocal=''       # Filesystems considered to be non-local to the 
system, pipe-separated
+Tiger_FSScan_PruneDirs='' # pipe-separated directories not to be considered
 #
 # Should we scan read-only filesystems
 #

Reply via email to