Sandbox option breaks on extraction of precise gnat-gps and gnat-gps-common

Bug #1059621 reported by Evan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Invalid
Undecided
Unassigned
gnat-gps (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned

Bug Description

To test:
mkdir -p /tmp/foo
dpkg -x gnat-gps-common*.deb /tmp/foo
dpkg -x gnat-gps_*.deb /tmp/foo

This should not produce:
tar: ./usr/share/doc/gnat-gps: Cannot create symlink to `gnat-gps-common': File exists

Original report follows:

In apport-retrace with the --sandbox option set, if gnat-gps-common_5.0-6_all.deb is extracted before gnat-gps_5.0-6_amd64.deb, the latter fails with:
tar: ./usr/share/doc/gnat-gps: Cannot create symlink to `gnat-gps-common': File exists

Revision history for this message
Evan (ev) wrote :
Download full text (4.8 KiB)

From the dpkg source:
  /* Check to see if it's a directory or link to one and we don't need to
   * do anything. This has to be done now so that we don't die due to
   * a file overwriting conflict. */
  existingdir = false;
  switch (ti->type) {
  case tar_filetype_symlink:
    /* If it's already an existing directory, do nothing. */
    if (!statr && S_ISDIR(stab.st_mode)) {
      debug(dbg_eachfiledetail, "tarobject symlink exists as directory");
      existingdir = true;
    } else if (!statr && S_ISLNK(stab.st_mode)) {
      if (linktosameexistingdir(ti, fnamevb.buf, &symlinkfn))
        existingdir = true;
    } ...

Read more...

Revision history for this message
Evan (ev) wrote :

So we can either write some Python code to open the tar (using python-apt/python-debian) and do the extracting itself, skipping existing directories, or use something like rsync --ignore-existing.

Revision history for this message
Evan (ev) wrote :
Evan (ev)
description: updated
Changed in apport (Ubuntu):
status: New → Invalid
no longer affects: apport (Ubuntu Precise)
Changed in gnat-gps (Ubuntu Precise):
status: New → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

Fixed in quantal:

gnat-gps (5.0-13) unstable; urgency=low

  * Avoid symlinking documentation directories (Closes: #684194).

 -- Nicolas Boulenguez <email address hidden> Thu, 16 Aug 2012 12:40:48 +0200

Changed in gnat-gps (Ubuntu):
status: New → Fix Released
Changed in gnat-gps (Ubuntu Precise):
status: Fix Committed → In Progress
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello Evan, or anyone else affected,

Accepted gnat-gps into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/gnat-gps/5.0-6ubuntu1 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 change the bug tag from verification-needed to verification-done. If it does not, 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!

Revision history for this message
Brian Murray (brian-murray) wrote : Verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for precise for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Colin Watson (cjwatson) wrote :

Looks OK now per Evan's test case.

tags: added: verification-done
removed: removal-candidate verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update 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 regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnat-gps - 5.0-6ubuntu1

---------------
gnat-gps (5.0-6ubuntu1) precise-proposed; urgency=low

  * Backport fix from Quantal (LP: #1059621):
    - Avoid symlinking documentation directories (Closes: #684194).
 -- Evan Dandrea <email address hidden> Wed, 17 Oct 2012 14:27:48 +0100

Changed in gnat-gps (Ubuntu Precise):
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.