]> git.saurik.com Git - apt.git/blobdiff - methods/server.cc
drop privileges in copy:// method as we do for file://
[apt.git] / methods / server.cc
index 934ec2abe6361c04192a31b0f26b7011d19b610f..650a4aeb8e3d19f1e92885ed2a99349a9114be8c 100644 (file)
@@ -274,7 +274,7 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
    // Not Modified
    if (Server->Result == 304)
    {
-      unlink(Queue->DestFile.c_str());
+      RemoveFile("server", Queue->DestFile);
       Res.IMSHit = true;
       Res.LastModified = Queue->LastModified;
       return IMS_HIT;
@@ -350,7 +350,7 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
            Server->StartPos = Server->TotalFileSize;
            Server->Result = 200;
         }
-        else if (unlink(Queue->DestFile.c_str()) == 0)
+        else if (RemoveFile("server", Queue->DestFile))
         {
            NextURI = Queue->Uri;
            return TRY_AGAIN_OR_REDIRECT;