Package: distmp3
Version: 0.1.9.ds1-4.4
Severity: serious
Tags: patch

Dear Maintainer,

Andreas Beckmann <[email protected]> reported in -devel that your package
(as well as 27 others) ships a folder either in /var/run or /var/lock. This
is forbidden by policy.

Lintian detects the problem and warns as follow:

/var/run may be a temporary filesystem, so any directories or files needed
/there must be created dynamically at boot time.

Refer to Debian Policy Manual section 9.3.2 (Writing the scripts) for
details.

Severity: serious, Certainty: possible
Check: files, Type: binary, udeb

which is why I am reporting this bug with severity serious (and there fore,
release critical).

Please fix your package. I have attached what I believe is a good fix the
problem, however, I haven't tried it, and I haven't tested if something more
for creating the necessary folder at runtime should be added. Please make
sure to test before applying the patch blindly.

Cheers,

Thomas Goirand (zigo)
diff -u distmp3-0.1.9.ds1/debian/rules distmp3-0.1.9.ds1/debian/rules
--- distmp3-0.1.9.ds1/debian/rules
+++ distmp3-0.1.9.ds1/debian/rules
@@ -17,7 +17,7 @@
 	dh_testroot
 	dh_clean -k
 	
-	dh_installdirs /usr/bin /etc /var/run/distmp3
+	dh_installdirs /usr/bin /etc
 	
 	install -m 755 distmp3 debian/distmp3/usr/bin
 	install -m 755 distmp3host debian/distmp3/usr/bin
diff -u distmp3-0.1.9.ds1/debian/distmp3.postinst distmp3-0.1.9.ds1/debian/distmp3.postinst
--- distmp3-0.1.9.ds1/debian/distmp3.postinst
+++ distmp3-0.1.9.ds1/debian/distmp3.postinst
@@ -18,8 +18,6 @@
     adduser --quiet --system --home /nonexistent --disabled-password \
             --no-create-home --group distmp3
   fi
-
-  chown $USER:$USER /var/run/distmp3
 fi
 
 #DEBHELPER#
diff -u distmp3-0.1.9.ds1/debian/changelog distmp3-0.1.9.ds1/debian/changelog
--- distmp3-0.1.9.ds1/debian/changelog
+++ distmp3-0.1.9.ds1/debian/changelog
@@ -1,3 +1,10 @@
+distmp3 (0.1.9.ds1-4.5) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes bad handling of /var/run/distmp3 life cycle (Closes: #XXXXXX).
+
+ -- Thomas Goirand <[email protected]>  Sat, 06 Oct 2012 16:43:30 +0800
+
 distmp3 (0.1.9.ds1-4.4) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u distmp3-0.1.9.ds1/debian/distmp3.init distmp3-0.1.9.ds1/debian/distmp3.init
--- distmp3-0.1.9.ds1/debian/distmp3.init
+++ distmp3-0.1.9.ds1/debian/distmp3.init
@@ -33,6 +33,13 @@
         
 set -e
 
+if [ ! -d /var/run/distmp3 ] ; then
+	mkdir -p /var/run/distmp3 || true
+	if [ -d /var/run/distmp3 ] ; then
+		chown distmp3:distmp3 /var/run/distmp3
+	fi
+fi
+
 case "$1" in
   start)
 	echo -n "Starting $DESC: $NAME"
only in patch2:
unchanged:
--- distmp3-0.1.9.ds1.orig/debian/distmp3.postrm
+++ distmp3-0.1.9.ds1/debian/distmp3.postrm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "purge" ] ; then
+	rm -rf /var/run/distmp3
+fi
+
+#DEBHELPER#
+

Reply via email to