diff options
Diffstat (limited to 'apt-pkg/indexcopy.cc')
-rw-r--r-- | apt-pkg/indexcopy.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index a2a1d5934..f88d51fc5 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -132,9 +132,14 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &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; @@ -661,7 +666,7 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, { string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); // FIXME: remove support for deprecated APT::GPGV setting - string const trustedFile = _config->FindFile("Dir::Etc::Trusted"); + string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted")); string const trustedPath = _config->FindDir("Dir::Etc::TrustedParts"); bool const Debug = _config->FindB("Debug::Acquire::gpgv", 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<string> keyrings = GetListOfFilesInDir(trustedPath, "gpg", false); + std::vector<string> keyrings; + if (DirectoryExists(trustedPath)) + keyrings = GetListOfFilesInDir(trustedPath, "gpg", false, true); if (FileExists(trustedFile) == true) - keyrings.push_back(trustedFile); + keyrings.push_back(trustedFile); std::vector<const char *> Args; Args.reserve(30); |