Skip to content

Commit

Permalink
fixup! lib: Move bareuseronly verification into commit/core
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Sep 21, 2017
1 parent c9454f2 commit b9b3abd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/libostree/ostree-repo-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3315,7 +3315,7 @@ _ostree_repo_import_object (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
const gboolean trusted = (flags & _OSTREE_REPO_IMPORT_FLAGS_VERIFY_CHECKSUM) == 0;
const gboolean trusted = (flags & _OSTREE_REPO_IMPORT_FLAGS_TRUSTED) > 0;
/* Implements OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES which was designed for flatpak */
const gboolean verify_bareuseronly = (flags & _OSTREE_REPO_IMPORT_FLAGS_VERIFY_BAREUSERONLY) > 0;

Expand Down
2 changes: 1 addition & 1 deletion src/libostree/ostree-repo-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ _ostree_repo_verify_commit_internal (OstreeRepo *self,

typedef enum {
_OSTREE_REPO_IMPORT_FLAGS_NONE,
_OSTREE_REPO_IMPORT_FLAGS_VERIFY_CHECKSUM,
_OSTREE_REPO_IMPORT_FLAGS_TRUSTED,
_OSTREE_REPO_IMPORT_FLAGS_VERIFY_BAREUSERONLY,
} OstreeRepoImportFlags;

Expand Down
4 changes: 2 additions & 2 deletions src/libostree/ostree-repo-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ import_one_local_content_object_sync (OtPullData *pull_data,
GError **error)
{
OstreeRepoImportFlags flags = _OSTREE_REPO_IMPORT_FLAGS_NONE;
if (pull_data->is_untrusted)
flags |= _OSTREE_REPO_IMPORT_FLAGS_VERIFY_CHECKSUM;
if (!pull_data->is_untrusted)
flags |= _OSTREE_REPO_IMPORT_FLAGS_TRUSTED;
if (pull_data->is_bareuseronly_files)
flags |= _OSTREE_REPO_IMPORT_FLAGS_VERIFY_BAREUSERONLY;
return _ostree_repo_import_object (pull_data->repo, src_repo,
Expand Down
3 changes: 1 addition & 2 deletions src/libostree/ostree-repo.c
Original file line number Diff line number Diff line change
Expand Up @@ -3423,8 +3423,7 @@ ostree_repo_import_object_from_with_trust (OstreeRepo *self,
GError **error)
{
/* This just wraps a currently internal API, may make it public later */
OstreeRepoImportFlags flags = trusted ? _OSTREE_REPO_IMPORT_FLAGS_NONE :
_OSTREE_REPO_IMPORT_FLAGS_VERIFY_CHECKSUM;
OstreeRepoImportFlags flags = trusted ? _OSTREE_REPO_IMPORT_FLAGS_TRUSTED : 0;
return _ostree_repo_import_object (self, source, objtype, checksum,
flags, cancellable, error);
}
Expand Down

0 comments on commit b9b3abd

Please sign in to comment.