Phaedrus Leeds 6d74eec0a9 dir: Verify subsummary checksum from disk cache
Currently we verify the checksum of indexed summary files (which have
.sub file names) before writing them to the on-disk cache, so in theory
as long as the disk I/O is successful the data integrity should be
intact when we use it via the flatpak-variant-impl-private.h helpers
generated by variant-schema-compiler. However in practice people
sometimes hit assertion failures which are what you would expect to see
if the data is corrupt, since GVariant stores some metadata such as the
"offset size" toward the end of the data, and if we read this from
serialized user data instead it will obviously be incorrect. In one case
I was able to acquire the flathub.idx, flathub.idx.sig, and
flathub-x86_64-fad08cfb10713e749f02a0e894b5d577b7e9c4931fdf9d2fdc50364c002bc925.sub
files which reproduce one of the assertion failures, and the sub file
appears to be incomplete, like the writing of it was interrupted.

We use g_file_replace_contents() when saving these to the disk, and when
not replacing an existing file that function writes directly to the
final filename, so if interrupted it would be expected to leave an
incomplete file.

This commit changes the summary file handling so that we verify the
checksum of any indexed subsummary again after reading it from disk. If
it doesn't match we delete the on-disk cache and try fetching from the
network.

Fixes #4127
2021-11-18 15:22:00 +01:00
2019-04-08 12:50:42 +00:00
2021-08-23 12:19:03 +02:00
2021-11-15 15:10:00 -08:00
2021-05-25 11:11:03 +02:00
2021-11-15 10:44:55 +01:00
2021-08-23 08:58:36 +02:00
2021-11-17 08:43:29 -08:00
2021-10-25 23:32:00 +01:00
2021-03-10 10:33:51 +01:00
2018-02-05 15:21:40 +00:00
2021-10-12 10:54:34 +01:00
2015-03-31 15:36:29 +01:00
2016-06-02 18:05:22 -04:00
2021-11-15 10:44:55 +01:00
2021-10-12 10:54:34 +01:00

Flatpak icon

Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux.

See https://flatpak.org/ for more information.

Community discussion happens in #flatpak:matrix.org, on the mailing list, and on the Flathub Discourse.

Read documentation for Flatpak here.

Contributing

Flatpak welcomes contributions from anyone! Here are some ways you can help:

Hacking

See CONTRIBUTING.md

Related Projects

Here are some notable projects in the Flatpak ecosystem:

  • Flatseal: An app for managing permissions of Flatpak apps without using the CLI
  • Souk: A Flatpak-only app store
  • Flat-manager: A tool for managing Flatpak repositories
Description
No description provided
Readme 60 MiB
Languages
C 91.1%
Shell 5.1%
Python 1.8%
Meson 1.1%
Yacc 0.8%