From: Michael Vogt Date: Tue, 7 Sep 2010 08:12:35 +0000 (+0200) Subject: * apt-pkg/indexcopy.cc: X-Git-Tag: 0.9.13.exp1ubuntu1~264 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/7dd61fad9a41ddd4279b51fb86d76a9484876e36?hp=3580e481e0dcbb4a39d687137eafcda60d8e85d5 * 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 --- diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index ed037027c..f88d51fc5 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; @@ -673,9 +678,11 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, std::clog << "Keyring path: " << trustedPath << std::endl; } - std::vector keyrings = GetListOfFilesInDir(trustedPath, "gpg", false); + std::vector keyrings; + if (DirectoryExists(trustedPath)) + keyrings = GetListOfFilesInDir(trustedPath, "gpg", false, true); if (FileExists(trustedFile) == true) - keyrings.push_back(trustedFile); + keyrings.push_back(trustedFile); std::vector Args; Args.reserve(30); diff --git a/debian/changelog b/debian/changelog index 2791a4e67..1c24a6b29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,10 @@ apt (0.8.2ubuntu1) maverick; urgency=low * apt-pkg/init.cc: - ignore ".distUpgrade" and ".save" files in sources.list.d (LP: #631770) + * 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 Tue, 07 Sep 2010 09:27:24 +0200