X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/be20eef52da4b7f361333ea70a8d705a98ae779e..f19d6a77f60b876e5453614d24886aabdd242ef6:/methods/gzip.cc?ds=inline diff --git a/methods/gzip.cc b/methods/gzip.cc index df3f8828f..637aae124 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -32,13 +32,23 @@ const char *Prog; class GzipMethod : public pkgAcqMethod { - virtual bool Fetch(FetchItem *Itm); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; + virtual bool Configuration(std::string Message) APT_OVERRIDE; public: GzipMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig) {}; }; +bool GzipMethod::Configuration(std::string Message) +{ + if (pkgAcqMethod::Configuration(Message) == false) + return false; + + DropPrivsOrDie(); + + return true; +} // GzipMethod::Fetch - Decompress the passed URI /*{{{*/ // --------------------------------------------------------------------- @@ -81,7 +91,7 @@ bool GzipMethod::Fetch(FetchItem *Itm) return false; // Read data from source, generate checksums and write - Hashes Hash; + Hashes Hash(Itm->ExpectedHashes); bool Failed = false; while (1) { @@ -139,5 +149,6 @@ int main(int, char *argv[]) ++Prog; GzipMethod Mth; + return Mth.Run(); }