[Pkg-clamav-devel] Bug#525358: Better testcase, --exclude-dir only works with a REGEX.

Michael Tautschnig mt at debian.org
Sun Nov 22 19:00:48 UTC 2009


> Thanks for the advice.  Just changing the option name, but using the old pattern syntax, didn't work in all cases, though.
> 
> I created a better testcase:
> # mkdir -p /tmp/clamtest/test1 /tmp/clamtest/kde-htest
> # mkdir -p /clamtest/test1
> # touch /tmp/clamtest/test1/clamtest.test1.sample.file
> # cp /tmp/kde-htest/konqueror-crash-Gpj9Ca.log /tmp/clamtest/kde-htest/
> # touch /clamtest/test1/clamtest.test1.sample.file
> # touch /clamtest/test1/junk
> # clamscan -r --exclude-dir=//clamtest/ /tmp /clamtest
> /tmp/clamtest/tmp.clamtest.sample.file: Empty file
> /tmp/clamtest/kde-htest/konqueror-crash-Gpj9Ca.log: OK
> /tmp/clamtest/tmp/temp.clamtest.tmp.sample.file: OK
> /tmp/.X0-lock: OK
> /clamtest/test1/clamtest.test1.sample.file: Empty file
> /clamtest/test1/junk: Empty file
> 
> So just changing from --exclude to --exclude-dir, using the original syntax for PATT of // to indicate a root directory doesn't work.
> 
> Later Internet search on "--exclude-dir" turned up http://www.linuxforums.org/forum/redhat-fedora-linux-help/56093-clam-av.html
> which shows the Fedora version of   clamscan --help   saying that the syntax is "--exclude-dir=REGEX"
> 
> I tested this and found that it works:
> # clamscan -r --exclude-dir=^/clamtest/ /tmp /clamtest
> /tmp/clamtest/tmp.clamtest.sample.file: Empty file
> /tmp/clamtest/kde-htest/konqueror-crash-Gpj9Ca.log: OK
> /tmp/clamtest/tmp/temp.clamtest.tmp.sample.file: OK
> /tmp/.X0-lock: OK
> /clamtest: Excluded
> 
> So sometime between clamav 0.92.1 and 0.94.dfsg.2-1lenny2, the syntax for --exclude-dir=PATT (and related options) changed to require PATT to be a regular expression.
> 
> Is there any chance of getting the man page and  --help  output changed to say REGEX instead of PATT?
> 

I'll let upstream know about this. In fact, the --help output depends on some
nowadays unused preprocessor option and thus does not reflect the actual
behavior. It's using regular expressions in all cases now.

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-clamav-devel/attachments/20091122/197f9cf2/attachment.pgp>


More information about the Pkg-clamav-devel mailing list