Package: libwrap0
Version: 7.6.q-23
Severity: important
Tags: patch
Hi,
libwrap0.postrm contains the following code:
if [ "$1" = "purge" ]; then
rm -f /etc/hosts.allow /etc/hosts.deny
fi
Thus if I install libwrap0 for multiple arches and then purge it for
only one of them, /etc/hosts.{allow,deny} will disappear.
Possible fixes:
a) Remove "Multi-Arch: same" for libwrap0.
b) Manage /etc/hosts.{allow,deny} in a separate package. The
reasons described in policy §8.2 and §10.7.4 already imply that
that would be a good change, but on the other hand I don't expect
the libwrap ABI to be broken any time soon, so it doesn't seem
too urgent.
c) Add a check that libwrap0 for other arches has already been
purged.
Compare http://bugs.debian.org/682420.
Here's a patch implementing (c). Untested. Thoughts?
---
debian/changelog | 7 +++++++
debian/libwrap0.postrm | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 3c408d0c..d59d228c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tcp-wrappers (7.6.q-23.1) local; urgency=low
+
+ * Only remove /etc/hosts.{allow,deny} on purge when the library has
+ already been purged for all other arches.
+
+ -- Jonathan Nieder <[email protected]> Sun, 22 Jul 2012 11:25:06 -0500
+
tcp-wrappers (7.6.q-23) unstable; urgency=medium
* Correctly install libwrap.{a,so} in the multiarch directory.
diff --git a/debian/libwrap0.postrm b/debian/libwrap0.postrm
index a2e992c5..2c8687ae 100644
--- a/debian/libwrap0.postrm
+++ b/debian/libwrap0.postrm
@@ -1,6 +1,6 @@
#!/bin/sh -e
-if [ "$1" = "purge" ]; then
+if [ "$1" = "purge" ] && [ $(dpkg-query -W libwrap0 | wc -l) = 1 ]; then
rm -f /etc/hosts.allow /etc/hosts.deny
fi
--
1.7.10.4
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]