]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
edsp: drop privileges before executing solvers
[apt.git] / apt-pkg / deb / dpkgpm.cc
index 834cb0e25262688d55a02fe4493e59cd401376c2..4a77942f169c711040e50c1fbf59ec0bc894798b 100644 (file)
@@ -477,7 +477,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
       close(Pipes[0]);
       FILE *F = fdopen(Pipes[1],"w");
       if (F == 0) {
-         result = _error->Errno("fdopen","Faild to open new FD");
+         result = _error->Errno("fdopen","Failed to open new FD");
          break;
       }
       
@@ -1501,6 +1501,13 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
               _exit(100);
         }
 
+        // if color support isn't enabled/disabled explicitly tell
+        // dpkg to use the same state apt is using for its color support
+        if (_config->FindB("APT::Color", false) == true)
+           setenv("DPKG_COLORS", "always", 0);
+        else
+           setenv("DPKG_COLORS", "never", 0);
+
         execvp(Args[0], (char**) &Args[0]);
         cerr << "Could not exec dpkg!" << endl;
         _exit(100);