1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

* g10.c (main), keydb.c (keydb_add_resource, keydb_locate_writable):

Rename --default-keyring as --primary-keyring.  Stefan wins the naming
contest.
This commit is contained in:
David Shaw 2002-11-25 03:18:48 +00:00
parent a5b9770a8b
commit ce4ddd144c
3 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2002-11-24 David Shaw <dshaw@jabberwocky.com>
* g10.c (main), keydb.c (keydb_add_resource,
keydb_locate_writable): Rename --default-keyring as
--primary-keyring. Stefan wins the naming contest.
2002-11-23 David Shaw <dshaw@jabberwocky.com>
* g10.c (add_notation_data): Disallow notation names that do not

View File

@ -141,7 +141,7 @@ enum cmd_and_opt_values { aNull = 0,
oAnswerNo,
oDefCertCheckLevel,
oKeyring,
oDefaultKeyring,
oPrimaryKeyring,
oSecretKeyring,
oShowKeyring,
oDefaultKey,
@ -421,7 +421,7 @@ static ARGPARSE_OPTS opts[] = {
{ oAnswerYes, "yes", 0, N_("assume yes on most questions")},
{ oAnswerNo, "no", 0, N_("assume no on most questions")},
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")},
{ oDefaultKeyring, "default-keyring",2, "@" },
{ oPrimaryKeyring, "primary-keyring",2, "@" },
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")},
{ oShowKeyring, "show-keyring", 0, N_("show which keyring a listed key is on")},
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")},
@ -1371,7 +1371,7 @@ main( int argc, char **argv )
case oAnswerYes: opt.answer_yes = 1; break;
case oAnswerNo: opt.answer_no = 1; break;
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
case oDefaultKeyring:
case oPrimaryKeyring:
sl=append_to_strlist( &nrings, pargs.r.ret_str);
sl->flags=2;
break;

View File

@ -55,7 +55,7 @@ struct resource_item {
static struct resource_item all_resources[MAX_KEYDB_RESOURCES];
static int used_resources;
static void *default_keyring=NULL;
static void *primary_keyring=NULL;
struct keydb_handle {
int locked;
@ -200,7 +200,7 @@ keydb_add_resource (const char *url, int flags, int secret)
else
{
if(flags&2)
default_keyring=token;
primary_keyring=token;
all_resources[used_resources].type = rt;
all_resources[used_resources].u.kr = NULL; /* Not used here */
all_resources[used_resources].token = token;
@ -211,10 +211,10 @@ keydb_add_resource (const char *url, int flags, int secret)
else
{
/* This keyring was already registered, so ignore it.
However, we can still mark it as default even if it was
However, we can still mark it as primary even if it was
already registered. */
if(flags&2)
default_keyring=token;
primary_keyring=token;
}
break;
@ -550,12 +550,12 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
if (rc)
return rc;
/* If we have a default set, try that one first */
if(default_keyring)
/* If we have a primary set, try that one first */
if(primary_keyring)
{
for ( ; hd->current >= 0 && hd->current < hd->used; hd->current++)
{
if(hd->active[hd->current].token==default_keyring)
if(hd->active[hd->current].token==primary_keyring)
{
if(keyring_is_writable (hd->active[hd->current].token))
return 0;