X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/2cae0ccb49efbeebe33f364b61e639ebf2639bdd..8f8ed8f4e50fd98aa43ee69971cac8bda55760f1:/apt-pkg/contrib/fileutl.cc?ds=inline diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 24e3f08d9..50019872e 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -43,7 +43,8 @@ #include #include -#ifndef WORDS_BIGENDIAN +#include +#ifdef WORDS_BIGENDIAN #include #endif /*}}}*/ @@ -66,6 +67,15 @@ bool RunScripts(const char *Cnf) // This is the child if (Child == 0) { + if (_config->FindDir("DPkg::Chroot-Directory","/") != "/") + { + std::cerr << "Chrooting into " + << _config->FindDir("DPkg::Chroot-Directory") + << std::endl; + if (chroot(_config->FindDir("DPkg::Chroot-Directory","/").c_str()) != 0) + _exit(100); + } + if (chdir("/tmp/") != 0) _exit(100);