apt-ftparchive sets permission of Packages file to 001 to

Bug #917845 reported by peter hicks
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Debian)
Fix Released
apt (Ubuntu)
Fix Released
Fix Released

Bug Description

When using apt-ftparchive with a config file, BinDirectory blocks don't inherit the default file permissions, causing them to end up with a permission of 0001

[Development Fix]
Fixed upstream in http://anonscm.debian.org/loggerhead/apt/debian-sid/revision/2013 ; incorporated into releases after Lucid.

[Stable Fix]
Cherry-picked the upstream patch - http://bazaar.launchpad.net/~l3on/ubuntu/lucid/apt/fix-917845/revision/107

[Text Case]
(lucid-amd64)root@caron:~# mkdir -p apt/conf
(lucid-amd64)root@caron:~# mkdir -p apt/dists/sid/{main,contrib,non-free}/{binary-i386,source}
(lucid-amd64)root@caron:~# mkdir -p apt/pool/{main,contrib,non-free}
(lucid-amd64)root@caron:~# cd apt/
(lucid-amd64)root@caron:~/apt# cp /usr/share/doc/apt-utils/examples/apt-ftparchive.conf conf/
(lucid-amd64)root@caron:~/apt# apt-ftparchive generate conf/apt-ftparchive.conf
(lucid-amd64)root@caron:~/apt# ls -l dists/sid/main/binary-i386/Packages

Broken result: ---------x 1 root root 0 Feb 29 09:37 dists/sid/main/binary-i386/Packages
Fixed result: -rw-r--r-- 1 root root 0 Feb 29 11:11 dists/sid/main/binary-i386/Packages

[Regression Potential]
Patch is isolated, straightforward, and contained within the apt-ftparchive tool.

[Original Report]
This is the same as Debian Bug#595922 and was introduced in It was not present in

apt-ftparchive changes permissions on the Packages files to 001:

strace -F -e chmod /usr/bin/apt-ftparchive generate conf/apt-ftparchive.conf

chmod("./dists/lucid/main/binary-amd64/Packages.bz2", 01) = 0
chmod("./dists/lucid/main/binary-amd64/Packages.gz", 01) = 0
chmod("./dists/lucid/main/binary-amd64/Packages", 01) = 0

E: Could not open file ./dists/lucid/main/binary-amd64/Packages - open (13: Permission denied)
E: Error processing contents dists/lucid/Contents-amd64

Related branches

Changed in apt (Debian):
status: Unknown → Fix Released
Leo Iannacone (l3on)
Changed in apt (Ubuntu):
assignee: nobody → Leo Iannacone (l3on)
Revision history for this message
Julian Andres Klode (juliank) wrote :

All versions past lucid are not affected by this bug. And it was certainly not introduced by; maybe, though.

Revision history for this message
Leo Iannacone (l3on) wrote :
Changed in apt (Ubuntu):
assignee: Leo Iannacone (l3on) → nobody
Bryce Harrington (bryce)
description: updated
Revision history for this message
Evan Broder (broder) wrote :

I've just uploaded this fix to lucid-proposed. Somebody from the SRU team should review it shortly.

description: updated
Changed in apt (Ubuntu):
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello peter, or anyone else affected,

Accepted apt 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 apt (Ubuntu):
status: Triaged → Fix Released
Changed in apt (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
peter hicks (pete-jl) wrote : Re: [Bug 917845] Re: apt-ftparchive sets permission of Packages file to 001 to

apt-utils- fixes the problem. thanks!

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

This bug was fixed in the package apt -

apt ( lucid-proposed; urgency=low

  * New patch from upstream ftparchive-fix-filemode-settings.patch:
    - Ensure that BinDirectory as well as Tree settings get the correct
      default FileMode setting (LP: #917845, Closes: #595922)
 -- Leo Iannacone <email address hidden> Tue, 31 Jan 2012 15:38:41 +0100

Changed in apt (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.