package vsftpd 2.2.2-3ubuntu6 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #629234 reported by Eric Collins
92
This bug affects 20 people
Affects Status Importance Assigned to Milestone
vsftpd (Debian)
Fix Released
Unknown
vsftpd (Ubuntu)
Fix Released
Medium
Dustin Kirkland 
Lucid
Fix Released
Medium
Unassigned
Maverick
Fix Released
Medium
Dustin Kirkland 

Bug Description

Binary package hint: vsftpd

I am not sure what to put here other then I am running Ubuntu 10.04 on a laptop. Ubuntu stated that it failed to install the package except that the vsftpd server is running fine. I connected with out a problem. I even went into the config file and
changed a setting then restarted the service. It appears to be running correctly. After making the change and restarting
the service I connected locally from my desktop to the ftp server with no problems. Even transfered several files. Then I noticed
the star shaped exclamation point on the task bar and now I am writing this..

Let me know if you need any more information such as specs of the machine. What I said above covers what I was doing/working on when the message appeared.

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: vsftpd 2.2.2-3ubuntu6
ProcVersionSignature: Ubuntu 2.6.32-24.42-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic i686
NonfreeKernelModules: fglrx
AptOrdering:
 vsftpd: Install
 vsftpd: Configure
Architecture: i386
Date: Thu Sep 2 19:18:44 2010
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
SourcePackage: vsftpd
Title: package vsftpd 2.2.2-3ubuntu6 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

=======
SRU Justification

IMPACT: This bug affects users installing vsftpd (see the numerous duplicate bugs).

REPRODUCE: Have an "ftp" user on your system, but no ftp group. Try installing the vsftpd package. Boom.

HOW FIXED: The logic in the postinst needs to be rearranged slightly. First check if the group exists, if not, add it. Then check if the user exists, if not add it to to the group.

PATCH: Attached. Uploaded to lucid-proposed for review there.

REGRESSION POTENTIAL: Minimal. I've tested the installation thoroughly. The new method is idempotent.

=======

Related branches

Revision history for this message
Eric Collins (collins-eric) wrote :
Changed in vsftpd (Ubuntu):
importance: Undecided → High
importance: High → Medium
Changed in vsftpd (Ubuntu):
status: New → Triaged
Changed in vsftpd (Ubuntu Lucid):
status: New → Triaged
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → Medium
Changed in vsftpd (Ubuntu Maverick):
assignee: nobody → Dustin Kirkland (kirkland)
status: Triaged → In Progress
Changed in vsftpd (Ubuntu Lucid):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vsftpd - 2.3.0~pre2-4ubuntu2

---------------
vsftpd (2.3.0~pre2-4ubuntu2) maverick; urgency=low

  * debian/vsftpd.postinst: Check that the group exists first, then
    the user, then try adding the user to the group, LP: #629234
 -- Dustin Kirkland <email address hidden> Fri, 03 Sep 2010 08:32:27 -0600

Changed in vsftpd (Ubuntu Maverick):
status: In Progress → Fix Released
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Patch attached.

description: updated
Changed in vsftpd (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
John Dong (jdong) wrote :

ACK from SRU team.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted vsftpd into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Verification for Lucid:
The version of vsftpd 2.2.2-3ubuntu7.1 in -proposed doesn't completely fix the issue. If a user whose name starts with ftp exists then the installation still fails.

To reproduce:
$ adduser ftpuser
$ apt-get install vsftpd

Using getent passwd ${_USERNAME} and getent group ${_USERNAME} instead of using grep should do the trick.

Marking as verification-failed.

Changed in vsftpd (Ubuntu Lucid):
status: Fix Committed → In Progress
tags: added: verification-failed
removed: verification-needed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

btw, the same problem still exists in maverick.

Changed in vsftpd (Ubuntu Lucid):
assignee: Dustin Kirkland (kirkland) → nobody
Revision history for this message
Imre Gergely (cemc) wrote :

Attached two patches for Maverick and Lucid. Do these look alright?

Revision history for this message
Imre Gergely (cemc) wrote :

And for Lucid...

Revision history for this message
Martin Pitt (pitti) wrote :

Subscribing ubuntu-sponsors.

Revision history for this message
Imre Gergely (cemc) wrote :

This was fixed in Natty but a little bit differently, see bug #656415 . Should the fix be taken from there and SRU'd back to Maverick and Lucid or is the above patch sufficient (or maybe even better) ?

In Natty there is this for checking if the user/group exists:

if ! getent passwd | grep -q "^${_USERNAME}:"
if ! getent group | grep -q "^${_USERNAME}:"

And in this bugreport the fix being suggested in comment #6 is using getent to find the entry, without using grep. If nothing else, it feels cleaner:

if ! getent passwd ${_USERNAME} >/dev/null 2>&1
if ! getent group ${_USERNAME} >/dev/null 2>&1

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Imre, I like the single call to getent better than the grep as well. There is an added benefit, which is that this key is taken literally, while passing it to grep may actually cause false positives by parsing as a regular expression. For instance, if you have a user

ftpuser

and you input

ftp.ser

As the user during configuration of vsftpd, it will match the . against the u and NOT create the user.

Revision history for this message
Imre Gergely (cemc) wrote :

Should this then be corrected in Natty also and then it can be SRU'd ?

Revision history for this message
Scott Moser (smoser) wrote :

Imre,
  You're right. What we really should do is
a.) open a new bug against vsftp in natty regarding the issue mentioned in comment 12.
b.) forward that bug to debian, with appropriate patch against debian

Then, we should apply that patch here.
We could then close this bug and request that one be SRU'd to hardy. I would think , though, it would be sufficient to simply fix hardy correctly under this bug.

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Evan Broder (broder) wrote :

You could potentially work around the regex misinterpretation issue by using some more complex combinations of grep and awk and so forth, but there's a better reason to not use getent | grep.

If /etc/nsswitch.conf is configured with a user or group database that doesn't support enumerating users (Hesiod, for instance, and probably LDAP under bad configurations), then the test will return false *negatives* and then try to create a user that already exists.

Revision history for this message
Scott Moser (smoser) wrote :

The debian bug is reported fixed in 2.3.2-7.

Revision history for this message
Daniel Holbach (dholbach) wrote :

The patch in comment 9 seems to be a bit different from the one that was sent to Debian, also does it remove a few changelog entries. Can somebody please have a look at it?

Revision history for this message
Martin Pitt (pitti) wrote :

Failed SRU, been in -proposed for > 100 days, I removed the proposed package.

Changed in vsftpd (Ubuntu Lucid):
status: In Progress → Triaged
Changed in vsftpd (Debian):
status: Unknown → Fix Released
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Since this failed SRU and interested parties have not commented on this bug for several weeks, is there still an intent to SRU this for lucid? If not, please adjust to "Won't Fix". Thanks!

Changed in vsftpd (Ubuntu Lucid):
status: Triaged → Incomplete
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Unsubscribing ubuntu-sponsors for now. Please resubscribe if an acceptable SRU patch is submitted.

Changed in vsftpd (Ubuntu Lucid):
assignee: nobody → Andres Rodriguez (andreserl)
status: Incomplete → In Progress
Changed in vsftpd (Ubuntu Lucid):
status: In Progress → Confirmed
assignee: Andres Rodriguez (andreserl) → nobody
Revision history for this message
Martin Pitt (pitti) wrote :

There are two conflicting vsftpd uploads in the lucid-proposed queue:

 vsftpd (2.2.2-3ubuntu6.1) lucid-proposed; urgency=low
 .
   * debian/vsftpd.postinst: (LP: #709194)
     - Update conditional to fix upgrade issue when user exists, but group does not

 vsftpd (2.2.2-3ubuntu6.1) lucid-proposed; urgency=low
 .
   [ Andres Rodriguez ]
   * debian/vsftpd.upstart:
     - Fix typo. Thanks to JÃŒrgen Kreileder (LP: #577165)
     - Fix start of vsftpd even if not in standalone mode. Thanks to
       Stephane Chazelas (LP: #648202)
 .
   [ Dustin Kirkland, Serge Hallyn ]
   * debian/vsftpd.postinst: Check that the group exists first, then the user,
     then try adding the user to the group. (LP: #629234, LP: #677764)

I rejected them both. Please reupload a merged version. Thanks!

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Martin,

I've marked bug #709194 as duplicate of this bug given that this bug bus reported earlier. Another reason for my decision is that the patch proposed is *not* the same fix that currently exists in natty. In turn the fix I'm proposing is indeed the same fix.

Could you please re-upload the proposed branch/lucid SRU linked to this bug report?

Thank you again!

Revision history for this message
Dave Walker (davewalker) wrote :

Re-uploading Andres branch based on the previous comment.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

APPROVED: the package version 2.2.2-3ubuntu6.2 uploaded to lucid-proposed should be accepted.

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted vsftpd into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in vsftpd (Ubuntu Lucid):
status: Confirmed → Fix Committed
tags: removed: verification-failed
tags: added: verification-needed
Revision history for this message
Imre Gergely (cemc) wrote :

I think this bug was corrected by the fix for bug #677764 . If that's the case, the package from -proposed is working (see comment #20 from that bugreport).

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vsftpd - 2.2.2-3ubuntu6.2

---------------
vsftpd (2.2.2-3ubuntu6.2) lucid-proposed; urgency=low

  * debian/vsftpd.upstart:
    - Fix typo. Thanks to Jürgen Kreileder (LP: #577165)
    - Fix start of vsftpd even if not in standalone mode. Thanks to
      Stephane Chazelas (LP: #648202)

  [ Dustin Kirkland, Serge Hallyn ]
  * debian/vsftpd.postinst: Check that the group exists first, then the user,
    then try adding the user to the group. (LP: #629234, LP: #677764)
 -- Andres Rodriguez <email address hidden> Wed, 13 Apr 2011 18:34:25 -0400

Changed in vsftpd (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.