]> git.saurik.com Git - apt.git/blobdiff - methods/http_main.cc
DropPrivs: Move the re-set uid/gid thing to the end of the function
[apt.git] / methods / http_main.cc
index 2c46ab19dbfe79fe19d6180b721bca9d0f964762..d7724701a761017dcf4e7ff2bf500715868c0f41 100644 (file)
@@ -1,15 +1,19 @@
+#include <config.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-method.h>
+#include <signal.h>
 
 
-#include "connect.h"
-#include "rfc2553emu.h"
 #include "http.h"
 
 #include "http.h"
 
-
 int main()
 {
    setlocale(LC_ALL, "");
 
 int main()
 {
    setlocale(LC_ALL, "");
 
+   // ignore SIGPIPE, this can happen on write() if the socket
+   // closes the connection (this is dealt with via ServerDie())
+   signal(SIGPIPE, SIG_IGN);
+
    HttpMethod Mth;
    HttpMethod Mth;
+
+   Mth.DropPrivsOrDie();
    return Mth.Loop();
 }
    return Mth.Loop();
 }