Directories titled "Sources" cause apt-cdrom to fail

Bug #750694 reported by Mario Limonciello
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Undecided
Julian Andres Klode

Bug Description

Binary package hint: apt

In a scenario that I'm installing, there is a directory that contains a subdirectory "Sources" on my installation media. I find that directory's presence causes the installation to fail at the stage that apt scans the cdrom.

Manually running apt-cdrom add provides the following error:
Read error - read (21: Is a directory).

Removing the directory causes that portion of the installation to succeed.

Attached in an strace log. The directory in question is /cdrom/PostVistaPE/Sources.

Revision history for this message
Mario Limonciello (superm1) wrote :
Revision history for this message
Torsten Spindler (tspindler) wrote :

Confirming this bog on Ubuntu 10.04 LTS:

$ sudo apt-cdrom add
Using CD-ROM mount point /media/apt/
Identifying.. [4e8258cfd5d73bbef22ecebcc2f9d3c0-2]
Scanning disc for index files..
Found 0 package indexes, 1 source indexes, 0 translation indexes and 0 signatures
Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1':
florp
Name: 'florp'
This disc is called:
'florp'
Copying package lists...E: Read error - read (21: Is a directory)

Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Torsten Spindler (tspindler) wrote :

This statement in cdrom.cc seems to return false:

SrcCopy.CopyPackages(CDROM,Name,SourceList, log)

Revision history for this message
Torsten Spindler (tspindler) wrote :

In indexcopy.cc it is checked if the file exists, GetFileName is defined in indexcopy.h and returns "Sources" for SrcCopy:

      if (FileExists(*I + GetFileName()) == true)
      {
  Pkg.Open(*I + GetFileName(),FileFd::ReadOnly);
  FileSize = Pkg.Size();
      }

Changed in apt (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Julian Andres Klode (juliank) wrote :

This has been fixed in apt's debian-sid branch on bzr.debian.org. Please note that this only works for directories and is generally not encouraged. Once we have done some final tests, we should be ready to upload a fixed version to Debian and Ubuntu.

apt (0.8.13.3) UNRELEASED; urgency=low

  * apt-pkg/indexcopy.cc:
    - Use RealFileExists() instead of FileExists(), allows amongst other
      things a directory named Sources to exist on a CD-ROM (LP: #750694).

Changed in apt (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.8.13.2ubuntu2

---------------
apt (0.8.13.2ubuntu2) natty; urgency=low

  [ Michael Vogt ]
  * debian/apt.cron.daily:
    - run unattended-upgrades even if there was a error during
      the apt-get update (LP: #676295)

  [ Julian Andres Klode ]
  * apt-pkg/indexcopy.cc:
    - Use RealFileExists() instead of FileExists(), allows amongst other
      things a directory named Sources to exist on a CD-ROM (LP: #750694).

  [ David Kalnischkies ]
  * apt-pkg/pkgcache.cc:
    - use the native Architecture stored in the cache header instead of
      loading it from configuration as suggested by Julian Andres Klode
 -- Michael Vogt <email address hidden> Thu, 07 Apr 2011 12:52:21 +0200

Changed in apt (Ubuntu):
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

Bug attachments

Remote bug watches

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