mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-21 19:48:05 +01:00
* 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.
This commit is contained in:
parent
14fdbdc97a
commit
fe01cbceb0
@ -1,3 +1,9 @@
|
|||||||
|
2005-03-31 Werner Koch <wk@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@jabberwocky.com>
|
2005-03-30 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* keyserver.c (keyserver_spawn): Don't mess about with the $PATH.
|
* keyserver.c (keyserver_spawn): Don't mess about with the $PATH.
|
||||||
|
@ -2924,7 +2924,7 @@ main( int argc, char **argv )
|
|||||||
case the secrings are stored on a floppy.
|
case the secrings are stored on a floppy.
|
||||||
|
|
||||||
We always need to add the keyrings if we are running under
|
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. */
|
secured files. */
|
||||||
if( ALWAYS_ADD_KEYRINGS
|
if( ALWAYS_ADD_KEYRINGS
|
||||||
|| (cmd != aDeArmor && cmd != aEnArmor
|
|| (cmd != aDeArmor && cmd != aEnArmor
|
||||||
@ -2935,12 +2935,12 @@ main( int argc, char **argv )
|
|||||||
&& cmd != aVerify && cmd != aSym))
|
&& cmd != aVerify && cmd != aSym))
|
||||||
{
|
{
|
||||||
if (!sec_nrings || default_keyring) /* add default secret rings */
|
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)
|
for (sl = sec_nrings; sl; sl = sl->next)
|
||||||
keydb_add_resource ( sl->d, 0, 1 );
|
keydb_add_resource ( sl->d, 0, 1 );
|
||||||
}
|
}
|
||||||
if( !nrings || default_keyring ) /* add default ring */
|
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 )
|
for(sl = nrings; sl; sl = sl->next )
|
||||||
keydb_add_resource ( sl->d, sl->flags, 0 );
|
keydb_add_resource ( sl->d, sl->flags, 0 );
|
||||||
}
|
}
|
||||||
|
18
g10/keydb.c
18
g10/keydb.c
@ -1,5 +1,5 @@
|
|||||||
/* keydb.c - key database dispatcher
|
/* 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.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -195,7 +195,8 @@ maybe_create_keyring (char *filename, int force)
|
|||||||
* Note: this function may be called before secure memory is
|
* Note: this function may be called before secure memory is
|
||||||
* available.
|
* available.
|
||||||
* Flag 1 == force
|
* Flag 1 == force
|
||||||
* Flag 2 == default
|
* Flag 2 == mark resource as primary
|
||||||
|
* Flag 4 == This is a default resources
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
keydb_add_resource (const char *url, int flags, int secret)
|
keydb_add_resource (const char *url, int flags, int secret)
|
||||||
@ -305,7 +306,18 @@ keydb_add_resource (const char *url, int flags, int secret)
|
|||||||
|
|
||||||
leave:
|
leave:
|
||||||
if (rc)
|
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)
|
else if (secret)
|
||||||
any_secret = 1;
|
any_secret = 1;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user