diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 4c8bfa3d48..9cfa642217 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -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; diff --git a/src/libostree/ostree-repo-private.h b/src/libostree/ostree-repo-private.h index 46a6eefd06..f5eb140e29 100644 --- a/src/libostree/ostree-repo-private.h +++ b/src/libostree/ostree-repo-private.h @@ -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; diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index d6ebac48f3..514d2041a3 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -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, diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index de29dd4b58..647840b785 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -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); }