]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-dump-solver.cc
Merge branch 'debian/sid' into debian/experimental
[apt.git] / cmdline / apt-dump-solver.cc
index 5bcfe4f0614098e705086dd082a90c22cb17052b..424764b3c35c5461e9ec3f8bf963f3a91480b0b6 100644 (file)
@@ -9,18 +9,21 @@
 // Include Files                                                       /*{{{*/
 #include <apt-pkg/edsp.h>
 
-#include <config.h>
-
+#include <string.h>
+#include <unistd.h>
 #include <cstdio>
+#include <iostream>
+
+#include <config.h>
                                                                        /*}}}*/
 
 // ShowHelp - Show a help screen                                       /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-bool ShowHelp() {
+static bool ShowHelp() {
 
        std::cout <<
-               PACKAGE " " VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl <<
+               PACKAGE " " PACKAGE_VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl <<
                "Usage: apt-dump-resolver\n"
                "\n"
                "apt-dump-resolver is a dummy solver who just dumps its input to the\n"
@@ -37,6 +40,8 @@ int main(int argc,const char *argv[])                                 /*{{{*/
                ShowHelp();
                return 0;
        }
+        // we really don't need anything
+        DropPrivs();
 
        FILE* input = fdopen(STDIN_FILENO, "r");
        FILE* output = fopen("/tmp/dump.edsp", "w");
@@ -46,5 +51,5 @@ int main(int argc,const char *argv[])                                 /*{{{*/
        fclose(output);
        fclose(input);
 
-       EDSP::WriteError("I am too dumb, i can just dump!", stdout);
+       EDSP::WriteError("ERR_JUST_DUMPING", "I am too dumb, i can just dump!\nPlease use one of my friends instead!", stdout);
 }