+ const char *Args[400];
+ unsigned int i = 0;
+
+ Args[i++] = gpgvpath.c_str();
+ Args[i++] = "--status-fd";
+ Args[i++] = "3";
+ Args[i++] = "--ignore-time-conflict";
+ for (vector<string>::const_iterator K = keyrings.begin();
+ K != keyrings.end(); ++K)
+ {
+ Args[i++] = "--keyring";
+ Args[i++] = K->c_str();
+ // check overflow (minus a bit of extra space at the end)
+ if(i >= sizeof(Args)/sizeof(char*)-5) {
+ std::clog << _("E: Too many keyrings should be passed to gpgv. Exiting.") << std::endl;
+ exit(111);
+ }
+ }
+
+ 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();
+ // check overflow (minus a bit of extra space at the end)
+ if(i >= sizeof(Args)/sizeof(char*)-5) {
+ std::clog << _("E: Argument list from Acquire::gpgv::Options too long. Exiting.") << std::endl;
+ exit(111);
+ }
+ }
+ }
+ Args[i++] = file;
+ Args[i++] = outfile;
+ Args[i++] = NULL;
+
+ if (Debug == true)