From 97bdb3b2714c07ba71ce25aadddee4182bc08118 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 20 Nov 2017 12:51:28 +0000 Subject: [PATCH] ostree/fsck: Verify commit bindings for each ref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since an OSTree client will refuse to pull from a remote which it has locally configured with a collection ID, if the commit on that remote has incorrect or missing bindings, we’d better verify them as part of fsck. Signed-off-by: Philip Withnall Closes: #1347 Approved by: cgwalters --- src/ostree/ot-builtin-fsck.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ostree/ot-builtin-fsck.c b/src/ostree/ot-builtin-fsck.c index 097af054..6ebb3c83 100644 --- a/src/ostree/ot-builtin-fsck.c +++ b/src/ostree/ot-builtin-fsck.c @@ -159,6 +159,10 @@ fsck_commit_for_ref (OstreeRepo *repo, return glnx_prefix_error (error, "Loading commit for ref %s", ref_name); } + /* Check its bindings. */ + if (!ostree_cmd__private__ ()->ostree_repo_verify_bindings (collection_id, ref_name, commit, error)) + return glnx_prefix_error (error, "Commit %s", checksum); + return TRUE; }