aboutsummaryrefslogtreecommitdiffstats
path: root/g10/card-util.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-09-27 12:56:05 +0000
committerWerner Koch <[email protected]>2004-09-27 12:56:05 +0000
commita2599936c9bac1efdadf748e92fa1341675d64f8 (patch)
treeae1c5771f727fd379d61eb724077a36dfb3e62ba /g10/card-util.c
parentWe need to take care that several files are also used in gnupg 1.9 and (diff)
downloadgnupg-a2599936c9bac1efdadf748e92fa1341675d64f8.tar.gz
gnupg-a2599936c9bac1efdadf748e92fa1341675d64f8.zip
* card-util.c (card_edit): Take admin only status from the table.
* app-openpgp.c: Made all strings translatable. (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin available for use in gnupg 2. (verify_chv3): Reimplemented countdown showing to use only functions from this module. Flush the CVH status cache on a successful read. (get_one_do): Hack to bypass the cache for cards versions > 1.0. (store_fpr): Store the creation date for card version > 1.0.
Diffstat (limited to 'g10/card-util.c')
-rw-r--r--g10/card-util.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/g10/card-util.c b/g10/card-util.c
index a58dda097..0ded216e2 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -1166,6 +1166,7 @@ card_edit (STRLIST commands)
const char *arg_string = "";
char *p;
int i;
+ int cmd_admin_only;
tty_printf("\n");
if (redisplay )
@@ -1208,46 +1209,39 @@ card_edit (STRLIST commands)
}
trim_spaces(answer);
}
- while( *answer == '#' );
+ while ( *answer == '#' );
arg_number = 0; /* Yes, here is the init which egcc complains about */
+ cmd_admin_only = 0;
if (!*answer)
cmd = cmdLIST; /* Default to the list command */
else if (*answer == CONTROL_D)
cmd = cmdQUIT;
- else {
- if ((p=strchr (answer,' ')))
- {
- *p++ = 0;
- trim_spaces (answer);
- trim_spaces (p);
- arg_number = atoi(p);
- arg_string = p;
- }
-
- for (i=0; cmds[i].name; i++ )
- if (!ascii_strcasecmp (answer, cmds[i].name ))
- break;
+ else
+ {
+ if ((p=strchr (answer,' ')))
+ {
+ *p++ = 0;
+ trim_spaces (answer);
+ trim_spaces (p);
+ arg_number = atoi(p);
+ arg_string = p;
+ }
+
+ for (i=0; cmds[i].name; i++ )
+ if (!ascii_strcasecmp (answer, cmds[i].name ))
+ break;
- cmd = cmds[i].id;
- }
+ cmd = cmds[i].id;
+ cmd_admin_only = cmds[i].admin_only;
+ }
- if(!allow_admin)
- switch(cmd)
- {
- case cmdNAME:
- case cmdURL:
- case cmdLOGIN:
- case cmdLANG:
- case cmdCAFPR:
- case cmdFORCESIG:
- case cmdGENERATE:
- tty_printf ("\n");
- tty_printf (_("Admin-only command\n"));
- continue;
- default:
- break;
- }
+ if (!allow_admin && cmd_admin_only)
+ {
+ tty_printf ("\n");
+ tty_printf (_("Admin-only command\n"));
+ continue;
+ }
switch (cmd)
{