From dd6da7d2392e2ad35c444ebc2d7bc2308380530c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 31 Aug 2015 02:31:10 +0200 Subject: ignore for _apt inaccessible TMPDIR in pkgAcqChangelog Using libpam-tmpdir caused us to create our download tmp directory in root's private tmp before changing to _apt, which wouldn't have access to it. By extending our GetTempDir method with an optional wrapper changing the effective user, we can test if a given user can access the directory and ignore TMPDIR if not instead of ignoring TMPDIR completely. Closes: 797270 --- apt-pkg/acquire-item.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index f505531c1..b6b6d8e48 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -2999,7 +2999,8 @@ void pkgAcqChangelog::Init(std::string const &DestDir, std::string const &DestFi if (DestDir.empty()) { - std::string const systemTemp = GetTempDir(); + std::string const SandboxUser = _config->Find("APT::Sandbox::User"); + std::string const systemTemp = GetTempDir(SandboxUser); char tmpname[100]; snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", systemTemp.c_str()); if (NULL == mkdtemp(tmpname)) @@ -3010,7 +3011,6 @@ void pkgAcqChangelog::Init(std::string const &DestDir, std::string const &DestFi } DestFile = TemporaryDirectory = tmpname; - std::string SandboxUser = _config->Find("APT::Sandbox::User"); ChangeOwnerAndPermissionOfFile("Item::QueueURI", DestFile.c_str(), SandboxUser.c_str(), "root", 0700); } -- cgit v1.2.3