ostree/src
Matthew Leeds e4e6d85ea4 avahi: Be robust to missing refs in peer summaries
In the OstreeRepoFinderAvahi implementation,
ostree_avahi_service_build_repo_finder_result() is where the DNS-SD
records are processed and turned into OstreeRepoFinderResult objects.
Each result object is supposed to have a hash table mapping refs to
checksums, so this is accomplished by first adding a placeholder (a ref
mapping to a NULL checksum) for each ref matched by the bloom filter,
and later filling in the checksums using the remote's summary file,
which happens in get_checksums(). The problem is that there's no
guarantee all the checksums will be resolved (non-NULL), so the
ostree_repo_finder_result_new() call then hits an assertion failure in
is_valid_collection_ref_map() leading to a crash (in the case that one
or more refs had NULL checksums).

There are at least two situations where the ref checksum might not be
found in the peer remote's summary file:
1) The bloom filter match was a false positive. This is going to happen
sometimes by design.
2) The peer remote's summary is out of sync with its DNS-SD records.
This shouldn't normally happen but it's still good to be robust to the
possibility; in Endless OS nothing guarantees the atomicity of updating
the summary and DNS-SD records.

This commit changes libostree to be robust to the possibility of refs
missing from the peer remote's summary, by removing any that still have
a NULL checksum associated with them after the summary has been fetched
and processed.

The other OstreeRepoFinder implementations don't have this issue because
they use summary files directly and therefore always have access to the
checksum.

Closes: #1717
Approved by: pwithnall
2018-09-07 10:19:24 +00:00
..
boot ostree-remount.service: RemainAfterExit=yes 2018-07-31 21:15:57 +00:00
libostree avahi: Be robust to missing refs in peer summaries 2018-09-07 10:19:24 +00:00
libotutil lib: Fix some logic/error-checking code 2018-07-26 21:01:19 +00:00
ostree ostree/config: Delete rogue printf and tweak help 2018-08-21 10:36:12 +00:00
rofiles-fuse Add SPDX-License-Identifier to source files 2018-01-30 20:03:42 +00:00
switchroot switchroot: Move late /run/ostree-booted creation to ostree-system-generator 2018-07-09 00:11:31 +00:00