summaryrefslogtreecommitdiffstats
path: root/g10/gpgv.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-04-03 12:34:22 +0200
committerWerner Koch <wk@gnupg.org>2009-04-03 12:34:22 +0200
commit7c98dad98e838d089261716a3823b7be53728fd3 (patch)
tree995baac48b0d8845cab6cf522eb1a43d16e325b8 /g10/gpgv.c
parentPrint the card's S/N in a secret key listing. (diff)
downloadgnupg2-7c98dad98e838d089261716a3823b7be53728fd3.tar.xz
gnupg2-7c98dad98e838d089261716a3823b7be53728fd3.zip
Make gpgv error message about a missing keyring more useful. This fixes
Debian#494040. Also implement readonly semantic for extra safety.
Diffstat (limited to 'g10/gpgv.c')
-rw-r--r--g10/gpgv.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/g10/gpgv.c b/g10/gpgv.c
index 88baaabab..2797139e3 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -193,12 +193,13 @@ main( int argc, char **argv )
if (opt.verbose > 1)
set_packet_list_mode(1);
-
- if (!nrings) /* no keyring given: use default one */
- keydb_add_resource ("trustedkeys" EXTSEP_S "gpg", 0, 0);
+
+ /* Note: We open all keyrings in read-only mode (flag value: 8). */
+ if (!nrings) /* No keyring given: use default one. */
+ keydb_add_resource ("trustedkeys" EXTSEP_S "gpg", 8, 0);
for (sl = nrings; sl; sl = sl->next)
- keydb_add_resource (sl->d, 0, 0 );
-
+ keydb_add_resource (sl->d, 8, 0 );
+
FREE_STRLIST (nrings);
if ( (rc = verify_signatures( argc, argv ) ))