mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
New command GETAUDITLOG
This commit is contained in:
parent
c1270f06fe
commit
95b57d9337
@ -1,3 +1,8 @@
|
|||||||
|
2007-11-22 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* server.c (cmd_getauditlog): New.
|
||||||
|
(register_commands): Register GETAUDITLOG
|
||||||
|
|
||||||
2007-11-19 Werner Koch <wk@g10code.com>
|
2007-11-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* server.c (cmd_recipient, cmd_signer): Add error reason 11.
|
* server.c (cmd_recipient, cmd_signer): Add error reason 11.
|
||||||
|
36
sm/server.c
36
sm/server.c
@ -933,6 +933,41 @@ cmd_genkey (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* GETAUDITLOG
|
||||||
|
|
||||||
|
!!!WORK in PROGRESS!!!
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
cmd_getauditlog (assuan_context_t ctx, char *line)
|
||||||
|
{
|
||||||
|
ctrl_t ctrl = assuan_get_pointer (ctx);
|
||||||
|
int out_fd;
|
||||||
|
FILE *out_fp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
if (!ctrl->audit)
|
||||||
|
return gpg_error (GPG_ERR_NO_DATA);
|
||||||
|
|
||||||
|
out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1);
|
||||||
|
if (out_fd == -1)
|
||||||
|
return set_error (GPG_ERR_ASS_NO_OUTPUT, NULL);
|
||||||
|
|
||||||
|
out_fp = fdopen ( dup(out_fd), "w");
|
||||||
|
if (!out_fp)
|
||||||
|
{
|
||||||
|
return set_error (GPG_ERR_ASS_GENERAL, "fdopen() failed");
|
||||||
|
}
|
||||||
|
audit_print_result (ctrl->audit, out_fp);
|
||||||
|
rc = 0;
|
||||||
|
fclose (out_fp);
|
||||||
|
|
||||||
|
/* Close and reset the fd. */
|
||||||
|
assuan_close_output_fd (ctx);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -961,6 +996,7 @@ register_commands (assuan_context_t ctx)
|
|||||||
{ "DUMPSECRETKEYS",cmd_dumpsecretkeys },
|
{ "DUMPSECRETKEYS",cmd_dumpsecretkeys },
|
||||||
{ "GENKEY", cmd_genkey },
|
{ "GENKEY", cmd_genkey },
|
||||||
{ "DELKEYS", cmd_delkeys },
|
{ "DELKEYS", cmd_delkeys },
|
||||||
|
{ "GETAUDITLOG", cmd_getauditlog },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
int i, rc;
|
int i, rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user