summaryrefslogtreecommitdiff
path: root/apt-pkg/indexcopy.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-05-07 17:45:10 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-05-07 17:45:10 +0000
commit94dc9d7d8bbf2f1351db26e4532327c6784ead96 (patch)
treede7a2193f47268c7974812604fb44b211b31040e /apt-pkg/indexcopy.cc
parent6cb30d01f8e247e85966ba8ad657453d73598527 (diff)
parent61abe43c0b6c74ef561c093bbd0c0d4626558655 (diff)
* merge with matt, search for the right patch next instead of applying them in order
Patches applied: * apt@packages.debian.org/apt--main--0--patch-77 Merge apt--mvo--0 * apt@packages.debian.org/apt--main--0--patch-78 Update changelog * apt@packages.debian.org/apt--main--0--patch-79 Merge michael.vogt@ubuntu.com--2005/apt--mvo--0 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-14 * changelog entry for 0.6.34ubuntu1 added, MinAge default is 2 days now * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-15 * merged with matts tree * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-16 * changelog updated * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-17 * whitespace change to add incomplete log for last patch * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-18 * honor "Acquire::gpgv::Options" in apt-cdrom too * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-19 * corrected a incorrect use of string().c_str() (thanks to mdz!) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-20 * supress output when /var/cache/apt/archives is empty; break when min-age is reached * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-21 * changed distro to "experimental", changed version number to 0.6.36
Diffstat (limited to 'apt-pkg/indexcopy.cc')
-rw-r--r--apt-pkg/indexcopy.cc34
1 files changed, 31 insertions, 3 deletions
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 4b6ac5ce0..1f65062f7 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -593,17 +593,45 @@ 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");
+ string releasegpg = *I+"Release.gpg";
+ string release = *I+"Release";
+
+ 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++] = releasegpg.c_str();
+ Args[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",