diff options
author | Christian Perrier <bubulle@debian.org> | 2005-03-05 09:28:33 +0000 |
---|---|---|
committer | Christian Perrier <bubulle@debian.org> | 2005-03-05 09:28:33 +0000 |
commit | 2c01f1c077870be1fb00663fc6bb80366498efab (patch) | |
tree | c7c997e669f03bd240c44cfbb64ed6d5fd7c2f03 /methods/gpgv.cc | |
parent | 7e360377931dbdea7ec3afe606bca39435353581 (diff) | |
parent | c8b944492073b938395fd890dfa8ed1e4b55fab4 (diff) |
Merge with matt
Patches applied:
* apt@packages.debian.org/apt--main--0--patch-59
Open 0.6.32
* apt@packages.debian.org/apt--main--0--patch-60
Merge apt--mvo--0
* apt@packages.debian.org/apt--main--0--patch-61
Add missing whitespace in new Debug::Acquire::gpgv output
* apt@packages.debian.org/apt--main--0--patch-62
Merge apt--mvo--0
* apt@packages.debian.org/apt--main--0--patch-63
Open 0.6.34
* apt@packages.debian.org/apt--main--0--patch-64
Add missing semicolon in configure-index (Debian #295773)
* apt@packages.debian.org/apt--main--0--patch-65
Update build-depends on gettext to 0.12
* michael.vogt@canonical.com--2004/apt--mvo--0--patch-12
* star-merged with matt, removed the unset("no_proxy") in methods/ftp.cc
* michael.vogt@canonical.com--2004/apt--mvo--0--patch-13
* commented the ftp no_proxy unseting in methods/ftp.cc
* michael.vogt@canonical.com--2004/apt--mvo--0--patch-14
* starmeged with matt, added some comments to the unsetting of no_proxy in ftp.cc
* michael.vogt@canonical.com--2004/apt--mvo--0--patch-15
* merged with matt's tree
* michael.vogt@canonical.com--2004/apt--mvo--0--patch-16
* added support for "Acquire::gpgv::options" in methods/gpgv.cc
* michael.vogt@ubuntu.com--2005/apt--mvo--0--base-0
tag of michael.vogt@canonical.com--2004/apt--mvo--0--patch-16
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-1
* slightly cosmetic change in methods/gpgv.cc
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-2
* merge with matts tree, added documentation for the gpgv stuff
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-3
* added gpgv::Options to configure-index
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-4
* PulseIntervall can be configured now to make frontends like synaptic hayppy. it's done in a way that does not break binary compatibility
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-5
* fix for apt-get update removing the cdroms Release.gpg files
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-6
* path scoring changed, the non-symlink path is scored highest
Diffstat (limited to 'methods/gpgv.cc')
-rw-r--r-- | methods/gpgv.cc | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc index b34ea8d85..24e945b2c 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -46,7 +46,7 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, int status; struct stat buff; string gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); - string pubringpath = _config->Find("Apt::GPGV::TrustedKeyring", "/etc/apt/trusted.gpg"); + string pubringpath = _config->Find("APT::GPGV::TrustedKeyring", "/etc/apt/trusted.gpg"); if (_config->FindB("Debug::Acquire::gpgv", false)) { std::cerr << "gpgv path: " << gpgvpath << std::endl; @@ -68,11 +68,41 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, } else if (pid == 0) { + const char *Args[400]; + unsigned int i = 0; + + Args[i++] = gpgvpath.c_str(); + Args[i++] = "--status-fd"; + Args[i++] = "3"; + 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 >= 395) { + std::cerr << "E: Argument list from Acquire::gpgv::Options too long. Exiting." << std::endl; + exit(111); + } + } + } + Args[i++] = file; + Args[i++] = outfile; + Args[i++] = NULL; + if (_config->FindB("Debug::Acquire::gpgv", false)) { - std::cerr << "Preparing to exec: " << gpgvpath - << " --status-fd 3 --keyring " << pubringpath - << " " << file << " " << outfile << std::endl; + std::cerr << "Preparing to exec: " << gpgvpath; + for(unsigned int j=0;Args[j] != NULL; j++) + std::cerr << " " << Args[j]; + std::cerr << std::endl; } int nullfd = open("/dev/null", O_RDONLY); close(fd[0]); @@ -85,8 +115,7 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, putenv("LANG="); putenv("LC_ALL="); putenv("LC_MESSAGES="); - execlp(gpgvpath.c_str(), gpgvpath.c_str(), "--status-fd", "3", "--keyring", - pubringpath.c_str(), file, outfile, NULL); + execvp(gpgvpath.c_str(), (char **)Args); exit(111); } |