mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
agent: Add option --status to the LISTRUSTED command.
* agent/trustlist.c (istrusted_internal): Add arg listmode and print new status line in this mode. Adjust callers. (agent_listtrusted): Add new args ctrl and status_mode. Get all trusted keys and then call is_trusted_internal for all of them. * agent/command.c (cmd_listtrusted): Add new option --status. -- This allows in a non-restricted connection to list all trusted keys in one go.
This commit is contained in:
parent
f50dde6269
commit
4275d5fa7a
3 changed files with 60 additions and 16 deletions
|
@ -569,22 +569,24 @@ cmd_istrusted (assuan_context_t ctx, char *line)
|
|||
|
||||
|
||||
static const char hlp_listtrusted[] =
|
||||
"LISTTRUSTED\n"
|
||||
"LISTTRUSTED [--status]\n"
|
||||
"\n"
|
||||
"List all entries from the trustlist.";
|
||||
"List all entries from the trustlist. With --status the\n"
|
||||
"keys are listed using status line similar to ISTRUSTED";
|
||||
static gpg_error_t
|
||||
cmd_listtrusted (assuan_context_t ctx, char *line)
|
||||
{
|
||||
ctrl_t ctrl = assuan_get_pointer (ctx);
|
||||
int rc;
|
||||
gpg_error_t err;
|
||||
int opt_status;
|
||||
|
||||
(void)line;
|
||||
opt_status = has_option (line, "--status");
|
||||
|
||||
if (ctrl->restricted)
|
||||
return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN));
|
||||
|
||||
rc = agent_listtrusted (ctx);
|
||||
return leave_cmd (ctx, rc);
|
||||
err = agent_listtrusted (ctrl, ctx, opt_status);
|
||||
return leave_cmd (ctx, err);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue