summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMatt Zimmerman <matt.zimmerman@canonical.com>2005-02-09 03:41:29 +0000
committerMatt Zimmerman <matt.zimmerman@canonical.com>2005-02-09 03:41:29 +0000
commit030f53710cd396ee6e716cc4d5791537581814bb (patch)
tree32af048e82e460540dbb9a29ce6d6dad7d76bb14 /methods
parent82b47aa557c4a137c6a7ed9bfc18bcc6124bf9f9 (diff)
parentec048f63365407f01766ef218165280cee805f1a (diff)
Merge apt--mvo--0
Patches applied: * 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
Diffstat (limited to 'methods')
-rw-r--r--methods/gpgv.cc39
1 files changed, 34 insertions, 5 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index b34ea8d85..f7d16ef01 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -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);
}