apt-cdrom -n replaces /dev/null with a regular file

Bug #612666 reported by Colin Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: apt

With apt 0.7.26~exp12ubuntu2, mount a CD image on /mnt, and run:

  sudo apt-cdrom -d /mnt -m -n -o Debug::aptcdrom=true -o Acquire::cdrom::AutoDetect=false add

/dev/null will be replaced by a regular file.

This is the fault of this code in apt-pkg/indexcopy.cc, which seems to have been around forever:

      if (_config->FindB("APT::CDROM::NoAct",false) == true)
         TargetF = "/dev/null";
      FileFd Target(TargetF,FileFd::WriteEmpty);

Don't we need something more like WriteExists in the case of /dev/null?

Related branches

Michael Vogt (mvo)
Changed in apt (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
milestone: none → ubuntu-10.10
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.6 KiB)

This bug was fixed in the package apt - 0.8.3ubuntu1

---------------
apt (0.8.3ubuntu1) maverick; urgency=low

  * merged fixes from debian-sid
  * debian/rules:
    - put ubuntu-archive.gpg back into the package (LP: #620576)
  * apt-pkg/init.cc:
    - ignore ".distUpgrade" and ".save" files in sources.list.d
      (LP: #631770)

apt (0.8.3) unstable; urgency=low

  [ Manpages translations ]
  * Japanese (KURASAWA Nozomu). Closes: #595862

  [ Michael Vogt ]
  * apt-pkg/indexcopy.cc:
    - only use trusted.gpg.d directory if it exists
    - do not replace /dev/null when running in APT::CDROM::NoAct
      mode (LP: #612666), thanks to Colin Watson

  [ David Kalnischkies ]
  * ftparchive/apt-ftparchive.cc:
    - ensure that BinDirectory as well as Tree settings get
      the correct default FileMode setting (Closes: #595922)

apt (0.8.2) unstable; urgency=low

  [ Manpages translations ]
  * Spanish (Omar Campagne). Closes: #595557

  [ David Kalnischkies ]
  * apt-pkg/versionmatch.cc:
    - do not accept 'Pin: origin "' (missing closing ") as a valid
      way to pin a local archive: either "" or none…
  * apt-pkg/deb/dpkgpm.cc:
    - create Dir::Log if needed to support /var/log as tmpfs or similar,
      inspired by Thomas Bechtold, thanks! (Closes: #523919, LP: #220239)
  * apt-pkg/indexcopy.cc:
    - support really still the APT::GPGV::TrustedKeyring setting,
      as it breaks d-i badly otherwise (Closes: #595428)
  * cmdline/apt-key:
    - support also Dir::Etc::Trusted so that apt-key works in the same
      way as the library part which works with the trusted files
  * methods/{gzip,bzip2}.cc:
    - empty files can never be valid archives (Closes: #595691)

apt (0.8.1) unstable; urgency=low

  [ Programs translations ]
  * Thai (Theppitak Karoonboonyanan). Closes: #592695
  * Russian (Yuri Kozlov). Closes: #594232
  * Slovak (Ivan Masár). Closes: #594255
  * Swedish (Daniel Nylander). Closes: #594241
  * Japanese (Kenshi Muto, Osamu Aoki). Closes: #594265
  * Italian (Milo Casagrande). Closes: #594238
  * Asturian (maacub). Closes: #594303
  * Simplified Chinese (Aron Xu). Closes: #594458
  * Bulgarian (Damyan Ivanov). Closes: #594627
  * Portuguese (Miguel Figueiredo). Closes: #594668
  * Korean (Changwoo Ryu). Closes: #594809
  * Norwegian Bokmål (Hans Nordhaug). Closes: #595182
  * Danish (Joe Hansen). Closes: #595176
  * Catalan (Agustí Grau). Closes: #595234

  [ Christian Perrier ]
  * Fix spelling error in cmdline/apt-get.cc. Thanks to Osamu Aoki
    Closes: #594211

  [ Manpages translations ]
  * Portuguese (Américo Monteiro)

  [ David Kalnischkies ]
  * cmdline/apt-cache.cc:
    - show in madison command again also source packages (LP: #614589)
    - remove useless GetInitialize method
  * cmdline/apt-get.cc:
    - remove direct calls of ReadMainList and use the wrapper instead
      to protect us from useless re-reads and two-times notice display
    - remove death code by removing unused GetInitialize
  * apt-pkg/depcache.cc:
    - now that apt-get purge works on 'rc' packages let the MarkDelete
      pass this purge forward to the non-pseudo package for pseudos
  * apt-pkg/contrib/fileutl.cc:
    - apply SilentlyIgnore...

Read more...

Changed in apt (Ubuntu):
status: In Progress → 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.