diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2015-05-28 16:25:51 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-06-04 17:54:42 -0400 |
commit | 94ef7669d74f7dd343838c9af1c0050d96440253 (patch) | |
tree | 7ed1ceb772d2d31261ce31ff2258c1477cb192fb /src | |
parent | 44e7e59d27497afb18648ee275702bb314248685 (diff) | |
download | ostree-94ef7669d74f7dd343838c9af1c0050d96440253.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | 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 330362ee..cb6d8f50 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; |