diff options
author | Colin Walters <walters@verbum.org> | 2017-12-05 14:27:15 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-12-12 14:03:09 +0000 |
commit | 73d910e82eb9076c3551eb9323d55d0a9c768e22 (patch) | |
tree | 86e5f51c9a14ce7186eca53ea98830d5f75be596 /apidoc | |
parent | 102f30f6cc601aeafd92481ff788bdd35e3f052d (diff) | |
download | ostree-73d910e82eb9076c3551eb9323d55d0a9c768e22.tar.gz |
Add public API for fsck, use it before loading metadata
A while ago I did `truncate -s 0 /path/to/repo/00/123.commit`, and expected a
checksum error, but I actually got a validation error due to us loading the
commit into a variant and trying to parse out the parent checksum, etc.
I first started by changing the `load_and_fsck_one_object()` function to
checksum before loading, but the problem is that we do a traverse of all objects
first. Fixing this is going to require an `OSTREE_REPO_COMMIT_TRAVER_FLAG_FSCK`
or something.
In the meantime at least though, let's add a public API to fsck a single object
which *does* checksum cleanly before parsing the object, and change the `fsck`
command to use it.
We then change the fsck binary to do this while iterating over the refs
and finding the commit object. This way we'll at least get a checksum
first for commit objects, even if not dirtree/dirmeta.
Closes: #1364
Approved by: jlebon
Diffstat (limited to 'apidoc')
-rw-r--r-- | apidoc/ostree-sections.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apidoc/ostree-sections.txt b/apidoc/ostree-sections.txt index b37c8914..4e474d8d 100644 --- a/apidoc/ostree-sections.txt +++ b/apidoc/ostree-sections.txt @@ -348,6 +348,7 @@ ostree_repo_import_object_from_with_trust ostree_repo_import_archive_to_mtree ostree_repo_export_tree_to_archive ostree_repo_delete_object +ostree_repo_fsck_object OstreeRepoCommitFilterResult OstreeRepoCommitFilter OstreeRepoCommitModifier |