From cfba4f6908927f46289f9fd945af02f12ee74412 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 3 Mar 2011 17:09:30 +0100 Subject: * apt-pkg/contrib/fileutl.cc, apt-pkg/deb/dpkgpm.cc: - honor Dpkg::Chroot-Directory in the RunScripts*() methods --- apt-pkg/contrib/fileutl.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 52f517ee0..935c4bebf 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -62,6 +62,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); -- cgit v1.2.3-70-g09d2