|
|
65ffb5 |
From 962a7f560ee0fa08eb30b0536d4ae9659ceaf163 Mon Sep 17 00:00:00 2001
|
|
|
65ffb5 |
From: Alexander Larsson <alexl@redhat.com>
|
|
|
65ffb5 |
Date: Wed, 8 May 2019 16:54:55 +0200
|
|
|
65ffb5 |
Subject: [PATCH 3/3] update: Fix OCI updates in the system repo
|
|
|
65ffb5 |
|
|
|
65ffb5 |
We need to check whether the remote is gpg verified after handling
|
|
|
65ffb5 |
the oci case, because OCI is fine to update systemwide without gpg
|
|
|
65ffb5 |
verification (in fact it doesn't support verification).
|
|
|
65ffb5 |
|
|
|
65ffb5 |
This just reorders the code, matching what is done in the install
|
|
|
65ffb5 |
case already.
|
|
|
65ffb5 |
|
|
|
65ffb5 |
Closes: #2891
|
|
|
65ffb5 |
Approved by: alexlarsson
|
|
|
65ffb5 |
|
|
|
65ffb5 |
(cherry picked from commit 4c4c80b85d629bad1a377524b7787200f1c831a0)
|
|
|
65ffb5 |
---
|
|
|
65ffb5 |
common/flatpak-dir.c | 32 ++++++++++++++++----------------
|
|
|
65ffb5 |
1 file changed, 16 insertions(+), 16 deletions(-)
|
|
|
65ffb5 |
|
|
|
65ffb5 |
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
|
|
|
65ffb5 |
index 79fa361d..1fc6a90c 100644
|
|
|
65ffb5 |
--- a/common/flatpak-dir.c
|
|
|
65ffb5 |
+++ b/common/flatpak-dir.c
|
|
|
65ffb5 |
@@ -8364,22 +8364,6 @@ flatpak_dir_update (FlatpakDir *self,
|
|
|
65ffb5 |
if (no_pull)
|
|
|
65ffb5 |
{
|
|
|
65ffb5 |
}
|
|
|
65ffb5 |
- else if ((!gpg_verify_summary && state->collection_id == NULL) || !gpg_verify)
|
|
|
65ffb5 |
- {
|
|
|
65ffb5 |
- /* The remote is not gpg verified, so we don't want to allow installation via
|
|
|
65ffb5 |
- a download in the home directory, as there is no way to verify you're not
|
|
|
65ffb5 |
- injecting anything into the remote. However, in the case of a remote
|
|
|
65ffb5 |
- configured to a local filesystem we can just let the system helper do
|
|
|
65ffb5 |
- the installation, as it can then avoid network i/o and be certain the
|
|
|
65ffb5 |
- data comes from the right place.
|
|
|
65ffb5 |
-
|
|
|
65ffb5 |
- If @collection_id is non-%NULL, we can verify the refs in commit
|
|
|
65ffb5 |
- metadata, so don’t need to verify the summary. */
|
|
|
65ffb5 |
- if (g_str_has_prefix (url, "file:"))
|
|
|
65ffb5 |
- helper_flags |= FLATPAK_HELPER_DEPLOY_FLAGS_LOCAL_PULL;
|
|
|
65ffb5 |
- else
|
|
|
65ffb5 |
- return flatpak_fail_error (error, FLATPAK_ERROR_UNTRUSTED, _("Can't pull from untrusted non-gpg verified remote"));
|
|
|
65ffb5 |
- }
|
|
|
65ffb5 |
else if (is_oci)
|
|
|
65ffb5 |
{
|
|
|
65ffb5 |
g_autoptr(FlatpakOciRegistry) registry = NULL;
|
|
|
65ffb5 |
@@ -8396,6 +8380,22 @@ flatpak_dir_update (FlatpakDir *self,
|
|
|
65ffb5 |
if (!flatpak_dir_mirror_oci (self, registry, state, ref, NULL, progress, cancellable, error))
|
|
|
65ffb5 |
return FALSE;
|
|
|
65ffb5 |
}
|
|
|
65ffb5 |
+ else if ((!gpg_verify_summary && state->collection_id == NULL) || !gpg_verify)
|
|
|
65ffb5 |
+ {
|
|
|
65ffb5 |
+ /* The remote is not gpg verified, so we don't want to allow installation via
|
|
|
65ffb5 |
+ a download in the home directory, as there is no way to verify you're not
|
|
|
65ffb5 |
+ injecting anything into the remote. However, in the case of a remote
|
|
|
65ffb5 |
+ configured to a local filesystem we can just let the system helper do
|
|
|
65ffb5 |
+ the installation, as it can then avoid network i/o and be certain the
|
|
|
65ffb5 |
+ data comes from the right place.
|
|
|
65ffb5 |
+
|
|
|
65ffb5 |
+ If @collection_id is non-%NULL, we can verify the refs in commit
|
|
|
65ffb5 |
+ metadata, so don’t need to verify the summary. */
|
|
|
65ffb5 |
+ if (g_str_has_prefix (url, "file:"))
|
|
|
65ffb5 |
+ helper_flags |= FLATPAK_HELPER_DEPLOY_FLAGS_LOCAL_PULL;
|
|
|
65ffb5 |
+ else
|
|
|
65ffb5 |
+ return flatpak_fail_error (error, FLATPAK_ERROR_UNTRUSTED, _("Can't pull from untrusted non-gpg verified remote"));
|
|
|
65ffb5 |
+ }
|
|
|
65ffb5 |
else
|
|
|
65ffb5 |
{
|
|
|
65ffb5 |
/* We're pulling from a remote source, we do the network mirroring pull as a
|
|
|
65ffb5 |
--
|
|
|
65ffb5 |
2.21.0
|
|
|
65ffb5 |
|