Res.LastModified = Buf.st_mtime;
     Res.IMSHit = false;      
     URIStart(Res);
 +
 +   // when the files are identical, just compute the hashes
 +   if(File == Itm->DestFile)
 +   {
 +      CalculateHashes(Res);
 +      URIDone(Res);
 +      return true;
 +   }
     
     // just calc the hashes if the source and destination are identical
     if (File == Itm->DestFile)
     setlocale(LC_ALL, "");
  
     CopyMethod Mth;
+ 
+    Mth.DropPrivsOrDie();
     return Mth.Run();
  }
 
  #include <apt-pkg/error.h>
  #include <apt-pkg/gpgv.h>
  #include <apt-pkg/strutl.h>
+ #include <apt-pkg/fileutl.h>
  
  #include <ctype.h>
  #include <errno.h>
     waitpid(pid, &status, 0);
     if (Debug == true)
     {
 -      std::clog << "gpgv exited\n";
 +      ioprintf(std::clog, "gpgv exited with status %i\n", WEXITSTATUS(status));
     }
     
     if (WEXITSTATUS(status) == 0)
  int main()
  {
     setlocale(LC_ALL, "");
-    
+ 
     GPGVMethod Mth;
  
+    Mth.DropPrivsOrDie();
+ 
     return Mth.Run();
  }