gnupg/g10 (ChangeLog g10.c keydb.c)

cvs user wk cvs at cvs.gnupg.org
Thu Mar 31 08:50:42 CEST 2005


    Date: Thursday, March 31, 2005 @ 09:05:35
  Author: wk
    Path: /cvs/gnupg/gnupg/g10

Modified: ChangeLog g10.c keydb.c

* keydb.c (keydb_add_resource): Clarify meaning of flags.  Add new
flag 4.  Use log_info for errors registering the default secret key.
* g10.c (main): Flag the default keyrings.


-----------+
 ChangeLog |    6 ++++++
 g10.c     |    6 +++---
 keydb.c   |   18 +++++++++++++++---
 3 files changed, 24 insertions(+), 6 deletions(-)


Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.715 gnupg/g10/ChangeLog:1.716
--- gnupg/g10/ChangeLog:1.715	Thu Mar 31 05:58:53 2005
+++ gnupg/g10/ChangeLog	Thu Mar 31 09:05:35 2005
@@ -1,3 +1,9 @@
+2005-03-31  Werner Koch  <wk at g10code.com>
+
+	* keydb.c (keydb_add_resource): Clarify meaning of flags.  Add new
+	flag 4.  Use log_info for errors registering the default secret key.
+	* g10.c (main): Flag the default keyrings.
+
 2005-03-30  David Shaw  <dshaw at jabberwocky.com>
 
 	* keyserver.c (keyserver_spawn): Don't mess about with the $PATH.
Index: gnupg/g10/g10.c
diff -u gnupg/g10/g10.c:1.297 gnupg/g10/g10.c:1.298
--- gnupg/g10/g10.c:1.297	Thu Jan 20 12:42:03 2005
+++ gnupg/g10/g10.c	Thu Mar 31 09:05:35 2005
@@ -2924,7 +2924,7 @@
        case the secrings are stored on a floppy.
        
        We always need to add the keyrings if we are running under
-       SELinux, thi is so that the rings are added to the list of
+       SELinux, this is so that the rings are added to the list of
        secured files. */
     if( ALWAYS_ADD_KEYRINGS 
         || (cmd != aDeArmor && cmd != aEnArmor
@@ -2935,12 +2935,12 @@
                 && cmd != aVerify && cmd != aSym))
           {
             if (!sec_nrings || default_keyring) /* add default secret rings */
-              keydb_add_resource ("secring" EXTSEP_S "gpg", 0, 1);
+              keydb_add_resource ("secring" EXTSEP_S "gpg", 4, 1);
             for (sl = sec_nrings; sl; sl = sl->next)
               keydb_add_resource ( sl->d, 0, 1 );
           }
 	if( !nrings || default_keyring )  /* add default ring */
-	    keydb_add_resource ("pubring" EXTSEP_S "gpg", 0, 0);
+	    keydb_add_resource ("pubring" EXTSEP_S "gpg", 4, 0);
 	for(sl = nrings; sl; sl = sl->next )
 	    keydb_add_resource ( sl->d, sl->flags, 0 );
       }
Index: gnupg/g10/keydb.c
diff -u gnupg/g10/keydb.c:1.14 gnupg/g10/keydb.c:1.15
--- gnupg/g10/keydb.c:1.14	Thu Oct 14 09:11:56 2004
+++ gnupg/g10/keydb.c	Thu Mar 31 09:05:35 2005
@@ -1,5 +1,5 @@
 /* keydb.c - key database dispatcher
- * Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -195,7 +195,8 @@
  * Note: this function may be called before secure memory is
  * available.
  * Flag 1 == force
- * Flag 2 == default
+ * Flag 2 == mark resource as primary
+ * Flag 4 == This is a default resources
  */
 int
 keydb_add_resource (const char *url, int flags, int secret)
@@ -305,7 +306,18 @@
 
   leave:
     if (rc)
-	log_error ("keyblock resource `%s': %s\n", filename, g10_errstr(rc));
+      {
+        /* Secret keyrings are not required in all cases.  To avoid
+           having gpg return failure we use log_info here if the
+           rewsource is a secret one and marked as default
+           resource.  */
+        if ((flags&4) && secret)
+          log_info (_("keyblock resource `%s': %s\n"),
+                    filename, g10_errstr(rc));
+        else
+          log_error (_("keyblock resource `%s': %s\n"),
+                     filename, g10_errstr(rc));
+      }
     else if (secret)
 	any_secret = 1;
     else




More information about the Gnupg-commits mailing list