[ostree: 66/70] Look for $remotename.trustedkeys.gpg in remotes.d dir



commit 7ac8b0442c022ffc3e200cbcf039455a0fc1dfbf
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Apr 8 17:00:59 2016 +0200

    Look for $remotename.trustedkeys.gpg in remotes.d dir
    
    This is a nice way to add gpg keys for system configured remotes
    without making them globally trusted.
    
    Closes: #247
    Approved by: cgwalters

 src/libostree/ostree-repo.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 72a2543..08e6a48 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -4575,6 +4575,7 @@ find_keyring (OstreeRepo          *self,
               OstreeRemote        *remote,
               GCancellable        *cancellable)
 {
+  g_autoptr(GFile) remotes_d = NULL;
   g_autoptr(GFile) file = NULL;
   file = g_file_get_child (self->repodir, remote->keyring);
 
@@ -4583,6 +4584,15 @@ find_keyring (OstreeRepo          *self,
       return g_steal_pointer (&file);
     }
 
+  remotes_d = get_remotes_d_dir (self);
+  if (remotes_d)
+    {
+      g_autoptr(GFile) file2 = g_file_get_child (remotes_d, remote->keyring);
+
+      if (g_file_query_exists (file2, cancellable))
+        return g_steal_pointer (&file2);
+    }
+
   if (self->parent_repo)
     return find_keyring (self->parent_repo, remote, cancellable);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]