summaryrefslogtreecommitdiff
path: root/apt-pkg/indexcopy.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-09-07 10:02:59 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-09-07 10:02:59 +0200
commit92e85e0b782ac79c795de60adc094b0c015e490d (patch)
tree7bbd000e64c259c175a1fed66c815382176621a5 /apt-pkg/indexcopy.cc
parentca07950ec545b41a18cbeff0ec0ba43624592c07 (diff)
parent8deb53abcc5c22cdbd8b17e0db8b752c3d2783c8 (diff)
* 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
Diffstat (limited to 'apt-pkg/indexcopy.cc')
-rw-r--r--apt-pkg/indexcopy.cc13
1 files changed, 10 insertions, 3 deletions
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<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;
@@ -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);