[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#689896: Ships a folder in /var/run or /var/lock (Policy Manual section 9.3.2)



Package: lastfmsubmitd
Version: 1.0.6-3
Severity: serious
Tags: patch

Dear Maintainer,

Andreas Beckmann <debian@abeckmann.de> 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 lastfmsubmitd-1.0.6/debian/lastfmsubmitd.dirs lastfmsubmitd-1.0.6/debian/lastfmsubmitd.dirs
--- lastfmsubmitd-1.0.6/debian/lastfmsubmitd.dirs
+++ lastfmsubmitd-1.0.6/debian/lastfmsubmitd.dirs
@@ -2,3 +2,2 @@
 var/log/lastfm
-var/run/lastfm
 var/spool/lastfm
diff -u lastfmsubmitd-1.0.6/debian/lastmp.init.d lastfmsubmitd-1.0.6/debian/lastmp.init.d
--- lastfmsubmitd-1.0.6/debian/lastmp.init.d
+++ lastfmsubmitd-1.0.6/debian/lastmp.init.d
@@ -23,6 +23,14 @@
     exit 0
 fi
 
+if [ ! -d ${RUNDIR} ] ; then
+	mkdir -p ${RUNDIR} || true
+	if [ -d ${RUNDIR} ] ; then
+		chown ${USER}:${GROUP} ${RUNDIR}
+		chmod 2775 ${RUNDIR}
+	fi
+fi
+
 case "$1" in
     start)
         echo -n "Starting $DESC: "
diff -u lastfmsubmitd-1.0.6/debian/lastfmsubmitd.init.d lastfmsubmitd-1.0.6/debian/lastfmsubmitd.init.d
--- lastfmsubmitd-1.0.6/debian/lastfmsubmitd.init.d
+++ lastfmsubmitd-1.0.6/debian/lastfmsubmitd.init.d
@@ -21,6 +21,14 @@
     exit 0
 fi
 
+if [ ! -d ${RUNDIR} ] ; then
+	mkdir -p ${RUNDIR} || true
+	if [ -d ${RUNDIR} ] ; then
+		chown ${USER}:${GROUP} ${RUNDIR}
+		chmod 2775 ${RUNDIR}
+	fi
+fi
+
 case "$1" in
     start)
         echo -n "Starting $DESC: "
diff -u lastfmsubmitd-1.0.6/debian/changelog lastfmsubmitd-1.0.6/debian/changelog
--- lastfmsubmitd-1.0.6/debian/changelog
+++ lastfmsubmitd-1.0.6/debian/changelog
@@ -1,3 +1,10 @@
+lastfmsubmitd (1.0.6-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes bad handling of /var/run/lastfm life cycle (Closes: #XXXXXX).
+
+ -- Thomas Goirand <zigo@debian.org>  Sat, 06 Oct 2012 18:41:00 +0800
+
 lastfmsubmitd (1.0.6-3) unstable; urgency=low
 
   * QA upload.
diff -u lastfmsubmitd-1.0.6/debian/lastfmsubmitd.postinst lastfmsubmitd-1.0.6/debian/lastfmsubmitd.postinst
--- lastfmsubmitd-1.0.6/debian/lastfmsubmitd.postinst
+++ lastfmsubmitd-1.0.6/debian/lastfmsubmitd.postinst
@@ -45,7 +45,7 @@
 
 db_get lastfmsubmitd/spool_group
 if [ "$RET" ]; then
-    for dir in /var/log/lastfm /var/run/lastfm /var/spool/lastfm; do
+    for dir in /var/log/lastfm /var/spool/lastfm; do
         chown "lastfm:$RET" $dir
         chmod 2775 $dir
     done

Reply to: