X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a75c6a6e17c6602a71e03aca8bafa96477a68706..899d08fea9e10d617afaa42f51f4abda76fc508f:/apt-pkg/indexcopy.cc diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 901001891..1f65062f7 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -263,10 +263,10 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, ioprintf(msg, _("Wrote %i records with %i missing files.\n"), Packages, NotFound); else if (NotFound == 0 && WrongSize != 0) - ioprintf(msg, _("Wrote %i records with %i mismachted files\n"), + ioprintf(msg, _("Wrote %i records with %i mismatched files\n"), Packages, WrongSize); if (NotFound != 0 && WrongSize != 0) - ioprintf(msg, _("Wrote %i records with %i missing files and %i mismachted files\n"), Packages, NotFound, WrongSize); + ioprintf(msg, _("Wrote %i records with %i missing files and %i mismatched files\n"), Packages, NotFound, WrongSize); } if (Packages == 0) @@ -593,17 +593,45 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &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",