Skip to content

Prefer mmap()ed consensus files over cached_dir_t entries.

Nick Mathewson requested to merge nickm/tor:bug40375_045_v2 into maint-0.4.5

Cached_dir_t is a somewhat "legacy" kind of storage when used for consensus documents, and it appears that there are cases when changing our settings causes us to stop updating those entries.

This can cause trouble, as @arma found out in #40375 (closed), where he changed his settings around, and consensus diff application got messed up: consensus diffs were being requested based on the latest consensus, but were being (incorrectly) applied to a consensus that was no longer the latest one.

This patch is a minimal fix for backporting purposes: it has Tor do the same search when applying consensus diffs as we use to request them. This should be sufficient for correct behavior.

There's a similar case in GETINFO handling; I've fixed that too.

Fixes #40375 (closed); bugfix on 0.3.1.1-alpha.


This bug is a bit rare, so let's try it out on main or 0.4.6 before we think about backporting it all the way to 0.4.5.

Merge request reports