]> git.saurik.com Git - apt.git/blobdiff - methods/server.cc
calculate only expected hashes in methods
[apt.git] / methods / server.cc
index 9b3d39cf2f85d8c391b08d6d29f608fe21d3b0b4..e403f10713c6c1c0acc69409237d48a36fa653cf 100644 (file)
@@ -129,7 +129,7 @@ bool ServerState::HeaderLine(string Line)
         if (elements == 3)
         {
            Code[0] = '\0';
-           if (Owner->Debug == true)
+           if (Owner != NULL && Owner->Debug == true)
               clog << "HTTP server doesn't give Reason-Phrase for " << Result << std::endl;
         }
         else if (elements != 4)
@@ -238,7 +238,12 @@ ServerState::ServerState(URI Srv, ServerMethod *Owner) : ServerName(Srv), TimeOu
 
 bool ServerMethod::Configuration(string Message)                       /*{{{*/
 {
-   return pkgAcqMethod::Configuration(Message);
+   if (pkgAcqMethod::Configuration(Message) == false)
+      return false;
+
+   DropPrivsOrDie();
+
+   return true;
 }
                                                                        /*}}}*/
 
@@ -352,7 +357,7 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
    FailFd = File->Fd();
    FailTime = Server->Date;
 
-   if (Server->InitHashes(*File) == false)
+   if (Server->InitHashes(*File, Queue->ExpectedHashes) == false)
    {
       _error->Errno("read",_("Problem hashing file"));
       return ERROR_NOT_FROM_SERVER;