1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Add gpgsm server command GETINFO agent-check.

Fix tests.
This commit is contained in:
Werner Koch 2008-09-30 10:30:20 +00:00
parent 7d63aa42e5
commit 8381a43ca7
8 changed files with 48 additions and 4 deletions

View file

@ -1016,6 +1016,7 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
version - Return the version of the program.
pid - Return the process id of the server.
agent-check - Return success if the agent is running.
*/
static int
@ -1035,6 +1036,11 @@ cmd_getinfo (assuan_context_t ctx, char *line)
snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ());
rc = assuan_send_data (ctx, numbuf, strlen (numbuf));
}
else if (!strcmp (line, "agent-check"))
{
ctrl_t ctrl = assuan_get_pointer (ctx);
rc = gpgsm_agent_send_nop (ctrl);
}
else
rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
return rc;