...
 
Commits (2)
...@@ -13,8 +13,9 @@ spamassassin (3.4.2-2) UNRELEASED; urgency=medium ...@@ -13,8 +13,9 @@ spamassassin (3.4.2-2) UNRELEASED; urgency=medium
* Import upstream fix for "Not a HASH reference at * Import upstream fix for "Not a HASH reference at
/usr/share/perl5/Mail/SpamAssassin/Plugin/FromNameSpoof.pm" /usr/share/perl5/Mail/SpamAssassin/Plugin/FromNameSpoof.pm"
(Closes: 910435) (Closes: 910435)
* Remove /var/lib/spamassassin/compiled during sa-compile upgrades.
-- -- Noah Meyerhans <noahm@debian.org> Sun, 16 Dec 2018 23:22:17 -0800
spamassassin (3.4.2-1) unstable; urgency=medium spamassassin (3.4.2-1) unstable; urgency=medium
......
...@@ -2,17 +2,23 @@ ...@@ -2,17 +2,23 @@
set -e set -e
umask 022
output_dir="/var/lib/spamassassin/compiled"
sa_compile() { sa_compile() {
OWNER=$(stat -c '%U' /var/lib/spamassassin) OWNER=$(stat -c '%U' /var/lib/spamassassin)
# Compile, if rules have previously been compiled, and it's possible
if [ -x /usr/bin/re2c -a -x /usr/bin/sa-compile ]; then if [ -x /usr/bin/re2c -a -x /usr/bin/sa-compile ]; then
echo "Running sa-compile (may take a long time)" echo "Running sa-compile (may take a long time)"
if [ -d "$output_dir" ]; then
rm -rf "$output_dir"
fi
su - $OWNER -c "sa-compile --quiet" su - $OWNER -c "sa-compile --quiet"
# Fixup perms -- group and other should be able to # Fixup perms -- group and other should be able to
# read and execute, but never write. Works around # read and execute, but never write. Works around
# sa-compile's failure to obey umask. # sa-compile's failure to obey umask.
runuser -u debian-spamd -- \ runuser -u debian-spamd -- \
chmod -R go-w,go+rX /var/lib/spamassassin/compiled chmod -R go-w,go+rX "$output_dir"
if command -v invoke-rc.d >/dev/null 2>&1; then if command -v invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d --quiet spamassassin status > /dev/null && \ invoke-rc.d --quiet spamassassin status > /dev/null && \
invoke-rc.d spamassassin reload > /dev/null 2>&1 || true invoke-rc.d spamassassin reload > /dev/null 2>&1 || true
......
...@@ -29,11 +29,6 @@ die_with_lint() { ...@@ -29,11 +29,6 @@ die_with_lint() {
} }
do_compile() { do_compile() {
# Compile rules if the required tools are available. Prior to version
# 3.3.2-8, there was an additional check to verify that an sa-compile
# run had previously been executed by hand. With sa-learn now
# distributed in a separate, optional, package, this check is no
# longer necessary.
if [ -x /usr/bin/re2c -a -x /usr/bin/sa-compile ]; then if [ -x /usr/bin/re2c -a -x /usr/bin/sa-compile ]; then
env -i LANG="$LANG" PATH="$PATH" start-stop-daemon \ env -i LANG="$LANG" PATH="$PATH" start-stop-daemon \
--chuid debian-spamd:debian-spamd --start \ --chuid debian-spamd:debian-spamd --start \
......