From 8deb53abcc5c22cdbd8b17e0db8b752c3d2783c8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Sep 2010 09:57:09 +0200 Subject: do not replace /dev/null when running in APT::CDROM::NoAct mode (LP: #612666), thanks to Colin Watson --- apt-pkg/indexcopy.cc | 7 ++++++- debian/changelog | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 0abbf63de..3156778d4 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -132,9 +132,14 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, (*I).c_str() + CDROM.length(),GetFileName()); string TargetF = _config->FindDir("Dir::State::lists") + "partial/"; TargetF += URItoFileName(S); + FileFd Target; if (_config->FindB("APT::CDROM::NoAct",false) == true) + { TargetF = "/dev/null"; - FileFd Target(TargetF,FileFd::WriteAtomic); + Target.Open(TargetF,FileFd::WriteExists); + } else { + Target.Open(TargetF,FileFd::WriteAtomic); + } FILE *TargetFl = fdopen(dup(Target.Fd()),"w"); if (_error->PendingError() == true) return false; diff --git a/debian/changelog b/debian/changelog index c81026041..3cdeb593f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ apt (0.8.2) unstable; urgency=low * 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 -- Michael Vogt Fri, 03 Sep 2010 20:21:43 +0200 -- cgit v1.2.3