pbuilder: remove_packages() checks for existence in host, not in chroot

Bug #1640892 reported by Mattia Rizzolo
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pbuilder (Debian)
Fix Released
Unknown
pbuilder (Ubuntu)
Fix Released
High
Unassigned
Yakkety
Fix Released
High
Unassigned

Bug Description

The fix:
https://anonscm.debian.org/git/pbuilder/pbuilder.git/commit/?id=bf1acdc

[Impact]

The remove_packages() function in pbuilder-modules contains:
    if (dpkg -s "$pkg" 2>&1)>/dev/null ; then
This obviously must
    if ($CHROOTEXEC dpkg -s "$pkg" 2>&1)>/dev/null ; then

This causes remove_packages() to try to remove packages that are not present, actually making the function not working at all in some circumstances, leading to crashes; or anyway, it causes it to try to remove packages from the chroot even when they are not there.

[Test Case]

2 ways:

1)
 * get a sarge chroot, or anyway around that time
 * assuming you have pbuilder installed on the host and not in the chroot,
   run:
       pbuilder u --removepackages pbuilder
 * pbuilder crashes
2)
 * get a regular chroot of something common these days
 * run `pbuilder u --removepackages pbuilder`
 * notice how it tries to remove pbuilder from inside the chroot (it
   shouldn't even try)

[Regression Potential]

 * for yakkety, no potential regression, this is a targeted fix.

Mattia Rizzolo (mapreri)
description: updated
Mattia Rizzolo (mapreri)
description: updated
Changed in pbuilder (Debian):
status: Unknown → Fix Committed
Changed in pbuilder (Debian):
status: Fix Committed → Fix Released
Mattia Rizzolo (mapreri)
Changed in pbuilder (Ubuntu):
importance: Undecided → High
Changed in pbuilder (Ubuntu Yakkety):
importance: Undecided → High
Graham Inggs (ginggs)
Changed in pbuilder (Ubuntu):
status: New → Fix Released
Graham Inggs (ginggs)
Changed in pbuilder (Ubuntu Yakkety):
status: New → In Progress
Revision history for this message
Mattia Rizzolo (mapreri) wrote :

here is a debdiff of the thing uploaded to yakkety.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Mattia, or anyone else affected,

Accepted pbuilder into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pbuilder/0.226.1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in pbuilder (Ubuntu Yakkety):
status: In Progress → Fix Committed
tags: added: verification-needed
Mattia Rizzolo (mapreri)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pbuilder - 0.226.1ubuntu0.1

---------------
pbuilder (0.226.1ubuntu0.1) yakkety; urgency=medium

  * modules: remove_packages: check for package existence in the chroot,
    not in the host. Closes: #840146; LP: #1640892

 -- Mattia Rizzolo <email address hidden> Tue, 29 Nov 2016 19:13:22 +0100

Changed in pbuilder (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for pbuilder has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.