]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
test if TMPDIR is accessible before using
[apt.git] / methods / http.cc
index b076e59ccc52f883fb96643acaef39f9d8550aa6..a5de13511bf3ced8f7920474ab2fd5f45393602e 100644 (file)
@@ -655,10 +655,11 @@ bool HttpServerState::Go(bool ToFile, FileFd * const File)
         return _error->Errno("write",_("Error writing to output file"));
    }
 
-   if (ExpectedSize > 0 && File && File->Tell() > ExpectedSize)
+   if (MaximumSize > 0 && File && File->Tell() > MaximumSize)
    {
+      Owner->SetFailReason("MaximumSizeExceeded");
       return _error->Error("Writing more data than expected (%llu > %llu)",
-                           File->Tell(), ExpectedSize);
+                           File->Tell(), MaximumSize);
    }
 
    // Handle commands from APT
@@ -769,6 +770,8 @@ bool HttpMethod::Configuration(string Message)
    if (ServerMethod::Configuration(Message) == false)
       return false;
 
+   DropPrivsOrDie();
+
    AllowRedirect = _config->FindB("Acquire::http::AllowRedirect",true);
    PipelineDepth = _config->FindI("Acquire::http::Pipeline-Depth",
                                  PipelineDepth);