Package: release.debian.org
Severity: normal
Tags: wheezy
User: release.debian....@packages.debian.org
Usertags: pu

proftpd-mod-geoip contains a broken postrm script that deletes a file
on upgrades after the new package has been unpacked. #726742

This can be triggered by either upgrades from wheezy to jessie or simply
in wheezy by the sequence

  install proftpd-mod-geoip
  remove (but don't purge) proftpd-mod-geoip
  install proftpd-mod-geoip

The proposed fix is to add a preinst script that deletes the broken
script *before* the new package gets unpacked.
Deleting is a safe solution because this is the only command in the
file, the #DEBHELPER# token was expanded to the empty string.

The same fix has been uploaded to sid as a NMU in DELAYED/2.
In sid the fix will be applied to the src:proftpd-dfsg package that has
taken over proftpd-mod-geoip as the module was integrated upstream.

Anreas
diff -Nru proftpd-mod-geoip-0.3/debian/changelog proftpd-mod-geoip-0.3/debian/changelog
--- proftpd-mod-geoip-0.3/debian/changelog	2011-08-03 16:12:17.000000000 +0200
+++ proftpd-mod-geoip-0.3/debian/changelog	2014-01-26 04:32:17.000000000 +0100
@@ -1,3 +1,13 @@
+proftpd-mod-geoip (0.3-1+deb7u1) wheezy; urgency=medium
+
+  * Non-maintainer upload.
+  * Remove useless and buggy proftpd-mod-geoip.postrm script.
+  * Add proftpd-mod-geoip.preinst script to delete the old buggy postrm script
+    on upgrades. Otherwise the buggy postrm script would delete some files
+    from the newly unpacked package.  (Closes: #726742)
+
+ -- Andreas Beckmann <a...@debian.org>  Sun, 26 Jan 2014 04:32:17 +0100
+
 proftpd-mod-geoip (0.3-1) unstable; urgency=low
 
   [ Fabrizio Regalli ]
diff -Nru proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.postrm proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.postrm
--- proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.postrm	2011-08-03 16:12:17.000000000 +0200
+++ proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.postrm	1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ -d /usr/lib/proftpd ]; then
-	echo "Deleting mod_geoip.."
-	rm -f /usr/lib/proftpd/mod_geoip.so
-fi
-
-#DEBHELPER#
-
diff -Nru proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.preinst proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.preinst
--- proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.preinst	1970-01-01 01:00:00.000000000 +0100
+++ proftpd-mod-geoip-0.3/debian/proftpd-mod-geoip.preinst	2014-01-26 04:31:52.000000000 +0100
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]
+then
+	if dpkg --compare-versions "$2" lt-nl "0.3-1+deb7u1"
+	then
+		rm -fv $(dpkg-query --control-path proftpd-mod-geoip postrm)
+	fi
+fi
+
+#DEBHELPER#

Reply via email to