summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-03-03 17:43:31 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-03-03 17:43:31 +0100
commit0245fd39e5bfb74c45cd70b815b603565e9529b6 (patch)
tree571a2c146e0230054686ac398170c5d17ccdc163 /apt-pkg/deb/dpkgpm.cc
parente50ebf9673515dd51475ccc6d2a5a9abfc620d73 (diff)
parentcfba4f6908927f46289f9fd945af02f12ee74412 (diff)
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc9
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";