[ostree] gpg: Gracefully handle no trusted.gpg.d directory



commit 94ef7669d74f7dd343838c9af1c0050d96440253
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu May 28 16:25:51 2015 -0400

    gpg: Gracefully handle no trusted.gpg.d directory
    
    This is a deprecated fallback method anyway.  We prefer
    remote-specific keyrings now.
    
    https://bugzilla.gnome.org/750049

 src/libostree/ostree-gpg-verifier.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/libostree/ostree-gpg-verifier.c b/src/libostree/ostree-gpg-verifier.c
index 330362e..cb6d8f5 100644
--- a/src/libostree/ostree-gpg-verifier.c
+++ b/src/libostree/ostree-gpg-verifier.c
@@ -84,13 +84,16 @@ ostree_gpg_verifier_initable_init (GInitable        *initable,
   if (!default_keyring_path)
     default_keyring_path = DATADIR "/ostree/trusted.gpg.d/";
 
-  default_keyring_dir = g_file_new_for_path (default_keyring_path);
-  if (!_ostree_gpg_verifier_add_keyring_dir (self, default_keyring_dir,
-                                             cancellable, error))
+  if (g_file_test (default_keyring_path, G_FILE_TEST_IS_DIR))
     {
-      g_prefix_error (error, "Reading keyring directory '%s'",
-                      gs_file_get_path_cached (default_keyring_dir));
-      goto out;
+      default_keyring_dir = g_file_new_for_path (default_keyring_path);
+      if (!_ostree_gpg_verifier_add_keyring_dir (self, default_keyring_dir,
+                                                 cancellable, error))
+        {
+          g_prefix_error (error, "Reading keyring directory '%s'",
+                          gs_file_get_path_cached (default_keyring_dir));
+          goto out;
+        }
     }
 
   ret = TRUE;


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