From 35f3ed061f10a25a3fb28bc988fddbb976344c4d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2016 15:54:06 +0200 Subject: edsp: prevent it from trying to write a cache EDSP(-like) protocols are one-shot processes working on data which exists only as long as they run (as they get feed via a pipe), so trying to write a cache for it is pretty pointless, especially as it will usually fail as the cache files tend to be owned by root, but the process is run as a unpriviledged user (either _apt if called by root, otherwise the user of the caller). So this was in fact only observeable with our testcases which run as non-root and the worst which happens is that a valid cache is overridden with an invalid one which the next run will detect and not use. Git-Dch: Ignore --- apt-pkg/edsp/edspsystem.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apt-pkg/edsp') diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index c3eea6f10..9b23dc3ca 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -60,11 +60,17 @@ pkgPackageManager *edspLikeSystem::CreatePM(pkgDepCache * /*Cache*/) const // System::Initialize - Setup the configuration space.. /*{{{*/ bool edspLikeSystem::Initialize(Configuration &Cnf) { + // state is included completely in the input files Cnf.Set("Dir::Etc::preferencesparts", "/dev/null"); Cnf.Set("Dir::State::status","/dev/null"); Cnf.Set("Dir::State::lists","/dev/null"); + // do not store an mmap cache + Cnf.Set("Dir::Cache::pkgcache", ""); + Cnf.Set("Dir::Cache::srcpkgcache", ""); + // the protocols only propose actions, not do them Cnf.Set("Debug::NoLocking", "true"); Cnf.Set("APT::Get::Simulate", "true"); + StatusFile.reset(nullptr); return true; } -- cgit v1.2.3