[Pkg-dspam-misc] Bug#356874: /etc/cron.daily/dspam: broken and
unduly complex
Aaron M. Ucko
ucko at debian.org
Tue Mar 14 15:19:17 UTC 2006
Package: dspam
Version: 3.6.4-2
Severity: normal
File: /etc/cron.daily/dspam
This morning's cron.daily run generated (among other things) the
following output:
/etc/cron.daily/dspam: line 8: [: StorageDriver: binary operator expected
Having taken a closer look, I have to conclude that the test in
question will *never* operate correctly without double quotes around
$DSPAMSTORAGE, which will otherwise expand either to nothing or to two
words, whereas your usage expects exactly one word.
Moreover, the script's logic is unduly complex. For one thing, it
features a "useless use of cat" (UUOC): in general, you can simplify
cat foo | grep bar
to
grep bar foo
There's also no need to capture grep's output for later inspection
when you can simply throw it away and use its exit status:
if grep -q "^StorageDriver.*hash_drv.so" $DSPAMCONF; then
# Found a match, proceed accordingly.
fi
BTW, why does the comment at the top of the script mention DB4 while
the code looks for the hash_drv backend, which appears to be
completely unrelated?
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages dspam depends on:
ii adduser 3.85 Add and remove users and groups
ii libc6 2.3.6-3 GNU C Library: Shared libraries an
ii libdspam7 3.6.4-2 DSPAM is a scalable and statistica
ii libldap2 2.1.30-13 OpenLDAP libraries
ii procmail 3.22-15 Versatile e-mail processor
Versions of packages dspam recommends:
ii clamav 0.88-4 antivirus scanner for Unix
ii dspam-doc 3.6.4-2 Documentation for dspam
-- no debconf information
More information about the Pkg-dspam-misc
mailing list