Dir::Cache=/dev/null chmods /dev/null
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
If you set Dir::Cache or Dir::Cache:
[Test plan]
1. autopkgtests run the large integration test suite
2. run manually
apt-cache gencaches -o Dir::Cache:
apt-cache gencaches -o Dir::Cache:
apt-cache gencaches -o Dir::Cache=
and observe that /dev/null is still correct.
[Where problems could occur]
We have eliminated writing the cache to /dev/null entirely:
--- a/apt-pkg/
+++ b/apt-pkg/
@@ -1637,6 +1637,10 @@ static DynamicMMap* CreateDynamicMM
static bool writeBackMMapTo
std::string const &FileName)
{
+ // Do not write the file back to /dev/null or try to change its mode...
+ if (FileName == "/dev/null")
+ return true;
It's possible we may introduce issues later because something in there does fancy bits and the cache in memory becomes invalid, but so far I only saw that we calculate the hash in there, but we set dirty afterwards and don't actually use the cache hash if we don't load from disk so I think in reality this is not a problem, at least now. Just gotta be careful to not stuff anything other than writing in there.
This bug was fixed in the package apt - 2.9.5
---------------
apt (2.9.5) unstable; urgency=medium
[ Julian Andres Klode ] pubkey- algo support.
* CI: Set /bin/sh shell for travis user, so flock -c works
* Fix test cases for non-amd64 architectures
* edsp: Parse source version from the Source-Version field
* Check gpgv --dump-options for --assert-
Thanks to Justus Winter for the idea
* Make the failure mode for non-executable tests stronger
* solver3: Do not dump sizes that are clearly pointers
* solver3: Group work items
* solver3: Remove no longer necessary comparisons
* solver3: Order obsolete choices last
[ Noah Meyerhans ]
* Fix spelling of @SNAPSHOTID@ in apt.conf.5.xml (Closes: #1072189)
[ Frans Spiesschaert ]
* Dutch program translation update (Closes: #1072493)
* Dutch manpages translation update (Closes: #1072494)
-- Julian Andres Klode <email address hidden> Thu, 13 Jun 2024 21:04:40 +0200