diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-03-03 17:43:31 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-03-03 17:43:31 +0100 |
commit | 0245fd39e5bfb74c45cd70b815b603565e9529b6 (patch) | |
tree | 571a2c146e0230054686ac398170c5d17ccdc163 /apt-pkg/deb/dpkgpm.cc | |
parent | e50ebf9673515dd51475ccc6d2a5a9abfc620d73 (diff) | |
parent | cfba4f6908927f46289f9fd945af02f12ee74412 (diff) |
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index f56e258e3..eeb57f715 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -308,6 +308,15 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf) SetCloseExec(STDIN_FILENO,false); SetCloseExec(STDERR_FILENO,false); + 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); + } + const char *Args[4]; Args[0] = "/bin/sh"; Args[1] = "-c"; |