Your message dated Sat, 15 Feb 2014 07:03:27 +0000
with message-id <e1wezhb-0000zb...@franck.debian.org>
and subject line Bug#738974: fixed in spamassassin 3.4.0-1
has caused the Debian Bug report #738974,
regarding sa-compile installation fails if directory isn't
debian-spamd:debian-spamd
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
738974: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738974
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: spamassassin
Version: 3.3.2-8
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu trusty ubuntu-patch
Hey,
Full disclosure: I'm running Ubuntu.
Somehow my /var/lib/spamassassin hadn't been chowned to
debian-spamd:debian-spamd. I'm not sure why; tracing back the upgrade
path didn't give me any clues. When I got sa-compile with -8, the script
couldn't run because debian-spamd (the user sa-compile is run as)
couldn't write to the directory. This failed the postinst, which bombs
out dpkg and apt (if used).
So I've modified the postinst to always chown in the following cases
- There's no statoverride specified by the local admin.
- The owner isn't the target (debian-spamd:debian-spamd) already.
...and to run programs under the user who owns the directory. I used the
following changelog.
* Always chown /var/lib/spamassassin if necessary; some upgrade paths might
have left it as root:root, in which case sa-compile's postinst will not
run successfully.
I guess you might want something like this in Debian too.
Thanks for considering the patch.
--
Iain Lane [ i...@orangesquash.org.uk ]
Debian Developer [ la...@debian.org ]
Ubuntu Developer [ la...@ubuntu.com ]
diff -Nru spamassassin-3.3.2/debian/sa-compile.postinst spamassassin-3.3.2/debian/sa-compile.postinst
--- spamassassin-3.3.2/debian/sa-compile.postinst 2014-02-09 23:56:29.000000000 +0000
+++ spamassassin-3.3.2/debian/sa-compile.postinst 2014-02-14 11:43:12.000000000 +0000
@@ -3,10 +3,11 @@
set -e
sa_compile() {
+ 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
echo "Running sa-compile (may take a long time)"
- su debian-spamd -c "sa-compile --quiet"
+ su $OWNER -c "sa-compile --quiet"
invoke-rc.d spamassassin restart
fi
}
diff -Nru spamassassin-3.3.2/debian/spamassassin.postinst spamassassin-3.3.2/debian/spamassassin.postinst
--- spamassassin-3.3.2/debian/spamassassin.postinst 2014-02-13 16:13:11.000000000 +0000
+++ spamassassin-3.3.2/debian/spamassassin.postinst 2014-02-14 11:43:10.000000000 +0000
@@ -3,23 +3,29 @@
set -e
if [ "$1" = "configure" ]; then
- # If a new install, or an upgrade from before 3.3.2-3 ...
- if dpkg --compare-versions "$2" "le" "3.3.2-2"; then
- if ! getent passwd debian-spamd > /dev/null ; then
- adduser --system --group --shell /bin/sh --disabled-password \
- --home /var/lib/spamassassin debian-spamd
- else
- mkdir -p /var/lib/spamassassin
- fi
- # Fix permissions of spamassassin; A no-op on new installs, lets
- # debian-spamd claim ownership of spamassassin updates on upgrades.
+ if ! getent passwd debian-spamd > /dev/null ; then
+ adduser --system --group --shell /bin/sh --disabled-password \
+ --home /var/lib/spamassassin debian-spamd
+ else
+ mkdir -p /var/lib/spamassassin
+ fi
+
+ OWNER=$(stat -c '%U' /var/lib/spamassassin)
+ GROUP=$(stat -c '%G' /var/lib/spamassassin)
+
+ # Lets debian-spamd claim ownership of spamassassin updates on upgrades,
+ # unless the user has overridden.
+ if ! dpkg-statoverride --list /var/lib/spamassassin/* >/dev/null && \
+ [ "$OWNER:$GROUP" != "debian-spamd:debian-spamd" ]; then
chown -R debian-spamd:debian-spamd /var/lib/spamassassin
+ OWNER=debian-spamd
+ GROUP=debian-spamd
fi
test -d /var/lib/spamassassin/sa-update-keys ||
- install -d -o debian-spamd -g debian-spamd -m 700 /var/lib/spamassassin/sa-update-keys
+ install -d -o $OWNER -g $GROUP -m 700 /var/lib/spamassassin/sa-update-keys
- su debian-spamd -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys \
+ su $OWNER -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys \
--import /usr/share/spamassassin/GPG.KEY"
fi
--- End Message ---
--- Begin Message ---
Source: spamassassin
Source-Version: 3.4.0-1
We believe that the bug you reported is fixed in the latest version of
spamassassin, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 738...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
no...@debian.org (supplier of updated spamassassin package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Fri, 14 Feb 2014 22:45:15 -0800
Source: spamassassin
Binary: spamassassin spamc sa-compile
Architecture: source all amd64
Version: 3.4.0-1
Distribution: unstable
Urgency: low
Maintainer: Noah Meyerhans <no...@debian.org>
Changed-By: no...@debian.org
Description:
sa-compile - Tools for compiling SpamAssassin rules into C
spamassassin - Perl-based spam filter using text analysis
spamc - Client for SpamAssassin spam filtering daemon
Closes: 738867 738872 738951 738963 738974
Changes:
spamassassin (3.4.0-1) unstable; urgency=low
.
* New upstream version! (Closes: 738963, 738872, 738867)
* Scrub the environment when switching to the debian-spamd user in
postinst and cron.daily. (Closes: 738951)
* Enhancements to postinst to better manage ownership of
/var/lib/spamassassin, via Iain Lane <iain.l...@canonical.com>
(Closes: 738974)
Checksums-Sha1:
287a1a72202a08f229db587ecc4a3d31d204e8db 1750 spamassassin_3.4.0-1.dsc
70ba5eed860406e2b016dd129eac81adbce395c9 204136
spamassassin_3.4.0.orig-pkgrules.tar.xz
4a0a423fd4846424754b90b19ab9e04d6e3b00d4 945292 spamassassin_3.4.0.orig.tar.xz
5f3b5c42da64a109ddc2264169c4abebda7d3015 35020
spamassassin_3.4.0-1.debian.tar.xz
e29f04ab34d2c528b2fe9cfdaafc7f85c2139c56 1105150 spamassassin_3.4.0-1_all.deb
0b7c5b56bef0eec4e0dd5fd87e9b5b88f6dbb0a0 87206 sa-compile_3.4.0-1_all.deb
ce3c0b80154508affd8dee6d0e643b4c62ae14dc 121968 spamc_3.4.0-1_amd64.deb
Checksums-Sha256:
f725827093883513b1b204a264a4b25a0c2e479b6e591035298bc3c9ffd9db67 1750
spamassassin_3.4.0-1.dsc
43b12f1a9d4ff1e51307d8d7ee04de7fb9b524723a3b3760df484afc55ef8b6c 204136
spamassassin_3.4.0.orig-pkgrules.tar.xz
310a891cccc611ee53dce1ef2f7166ca2ae9de3e299ed11c1b502886d2696771 945292
spamassassin_3.4.0.orig.tar.xz
a189836d8a2367c4aa911e468d0e1a30a8a5bb456e9978c6c795992557428413 35020
spamassassin_3.4.0-1.debian.tar.xz
c4dbbe4c2b4a0656dd37fca2a523c26d5d9e9c0688d3af1fa10c03718bea7a33 1105150
spamassassin_3.4.0-1_all.deb
dffe852c29b98767c740f51595f0238323b517580e0e2ce69de852c997036ac8 87206
sa-compile_3.4.0-1_all.deb
d79a36545e41c16b936f9dbdf79f581611f3f9a2009f3295ad3690beb05ee60e 121968
spamc_3.4.0-1_amd64.deb
Files:
e670418b2b9e3b178ae790179a6fe5a6 1750 mail optional spamassassin_3.4.0-1.dsc
40577e5402cb700031df39ac72cd5542 204136 mail optional
spamassassin_3.4.0.orig-pkgrules.tar.xz
42a6cc14bf557e00dbee829815b83a6d 945292 mail optional
spamassassin_3.4.0.orig.tar.xz
21d0dbf914d87be532761a3edee13cf5 35020 mail optional
spamassassin_3.4.0-1.debian.tar.xz
cae719d31f368e730dd5c64233d385e2 1105150 mail optional
spamassassin_3.4.0-1_all.deb
5e8b119764683e8c67b6748716867b1b 87206 mail optional sa-compile_3.4.0-1_all.deb
450557b36a14261051cd3c2d04c0d0ce 121968 mail optional spamc_3.4.0-1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iD8DBQFS/xAHYrVLjBFATsMRAqjWAJ9jD0ndXH3iotbHy3UTvcSDleIbfACdEqte
dSs0ppEA1//oVViPm80Jn0I=
=TZxn
-----END PGP SIGNATURE-----
--- End Message ---