Package: lastfmsubmitd
Version: 1.0.5-1.1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu lucid ubuntu-patch

:: DESCRIPTION ::
If the user enters a non-existent group at the lastfmsubmitd/spool_group 
prompt, the installation fails with
chown: invalid group: `lastfm:firstfm'
dpkg: error processing lastfmsubmitd (--configure):
 subprocess post-installation script returned error exit status 1

:: VERSION ::
lastfmsubmitd | 0.36-1 | hardy/universe | source, all
lastfmsubmitd | 0.37-2 | intrepid/universe | source, all
lastfmsubmitd | 0.37-3 | jaunty/universe | source, all
lastfmsubmitd | 1.0.5-1 | karmic/universe | source, all
lastfmsubmitd | 1.0.5-1 | lucid/universe | source, all

:: HOW TO REPRODUCE ::
When prompt with the question: "Group that may send submissions:" enter a group 
name that doesn't exist on your system and different from the default value 
"lastfm"

:: WORKAROUND ::
Keep the default.

:: FAULTY CODE ::
in debian/lastfmsubmitd.postinst:

db_get lastfmsubmitd/spool_group
if [ "$RET" ]; then
    for dir in /var/log/lastfm /var/run/lastfm /var/spool/lastfm; do
        chown "lastfm:$RET" $dir
        chmod 2775 $dir
    done
fi


*** /tmp/tmpxsubrf
In Ubuntu, we've applied the attached patch to achieve the following:

  * lastfmsubmitd.postinst: Create spool group if it doesn't exist. (LP: 
#386240)


The other solution would have been to skip the chown loop if when the group 
doesn't exists. 

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: squeeze/sid
  APT prefers lucid-updates
  APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 
'lucid-proposed'), (500, 'lucid-backports'), (500, 'lucid')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-9-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u lastfmsubmitd-1.0.5/debian/changelog lastfmsubmitd-1.0.5/debian/changelog
diff -u lastfmsubmitd-1.0.5/debian/lastfmsubmitd.postinst lastfmsubmitd-1.0.5/debian/lastfmsubmitd.postinst
--- lastfmsubmitd-1.0.5/debian/lastfmsubmitd.postinst
+++ lastfmsubmitd-1.0.5/debian/lastfmsubmitd.postinst
@@ -45,6 +45,9 @@
 
 db_get lastfmsubmitd/spool_group
 if [ "$RET" ]; then
+    if ! getent group "$RET" >/dev/null; then
+        addgroup --force-badname "$RET" 
+    fi
     for dir in /var/log/lastfm /var/run/lastfm /var/spool/lastfm; do
         chown "lastfm:$RET" $dir
         chmod 2775 $dir
diff -u lastfmsubmitd-1.0.5/debian/control lastfmsubmitd-1.0.5/debian/control
--- lastfmsubmitd-1.0.5/debian/control
+++ lastfmsubmitd-1.0.5/debian/control
@@ -1,7 +1,8 @@
 Source: lastfmsubmitd
 Section: sound
 Priority: optional
-Maintainer: Decklin Foster <deck...@red-bean.com>
+Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
+XSBC-Original-Maintainer: Decklin Foster <deck...@red-bean.com>
 Build-Depends: debhelper (>= 6), python-dev, po-debconf
 Build-Depends-Indep: python-support (>= 0.6)
 Standards-Version: 3.8.0

Reply via email to