summaryrefslogtreecommitdiff
path: root/apt-pkg/aptconfiguration.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-08-22 23:00:31 +0200
committerMichael Vogt <mvo@debian.org>2013-08-22 23:00:31 +0200
commit6fd51a5f4300f4b1563cdf2a34f59e6bbaacb838 (patch)
tree6469d9c9f58ebce2557a9689b8907752990734b3 /apt-pkg/aptconfiguration.cc
parent329dea2d39d2518e43f0761c1c89990857e197ad (diff)
parent2510eea4a0922b7b6da8099deb70ca87851633ce (diff)
Merge branch 'debian/sid' of ssh://git.debian.org/git/apt/apt into debian/sid
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r--apt-pkg/aptconfiguration.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index e32e553a4..4f9b84e00 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -392,7 +392,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
dup2(nullfd, STDIN_FILENO);
dup2(external[1], STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);
- if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0)
+ if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0 && chdir("/") != 0)
_error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --print-foreign-architectures", chrootDir.c_str());
execvp(Args[0], (char**) &Args[0]);
_error->WarningE("getArchitecture", "Can't detect foreign architectures supported by dpkg!");