diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-04-06 11:47:32 +0000 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-04-06 11:47:32 +0000 |
commit | 279048500953d786320065d0140b74a08d3a6368 (patch) | |
tree | 269c13714b1622ae4e9b4b548b1706bc69479367 /apt-pkg | |
parent | 9f4050313c75c9897b7988a62a8288f5dcea4270 (diff) |
* honor "Acquire::gpgv::Options" in apt-cdrom too
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/indexcopy.cc | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 4b6ac5ce0..77426386d 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -593,17 +593,41 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList, // verify the gpg signature of "Release" // gpg --verify "*I+Release.gpg", "*I+Release" + const char *Args[400]; + unsigned int i = 0; + string gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); string pubringpath = _config->Find("Apt::GPGV::TrustedKeyring", "/etc/apt/trusted.gpg"); + Args[i++] = gpgvpath.c_str(); + Args[i++] = "--keyring"; + Args[i++] = pubringpath.c_str(); + Configuration::Item const *Opts; + Opts = _config->Tree("Acquire::gpgv::Options"); + if (Opts != 0) + { + Opts = Opts->Child; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Value.empty() == true) + continue; + Args[i++] = Opts->Value.c_str(); + if(i >= 390) { + _error->Error("Argument list from Acquire::gpgv::Options too long. Exiting."); + return false; + } + } + } + Args[i++] = string(*I+"Release.gpg").c_str(); + Args[i++] = string(*I+"Release").c_str(); + Args[i++] = NULL; + pid_t pid = ExecFork(); if(pid < 0) { _error->Error("Fork failed"); return false; } if(pid == 0) { - execlp(gpgvpath.c_str(), gpgvpath.c_str(), "--keyring", - pubringpath.c_str(), string(*I+"Release.gpg").c_str(), - string(*I+"Release").c_str(), NULL); + execvp(gpgvpath.c_str(), (char**)Args); } if(!ExecWait(pid, "gpgv")) { _error->Warning("Signature verification failed for: %s", |