summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.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/contrib/fileutl.cc
parente50ebf9673515dd51475ccc6d2a5a9abfc620d73 (diff)
parentcfba4f6908927f46289f9fd945af02f12ee74412 (diff)
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 767951daf..50019872e 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -67,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);