diff options
author | Werner Koch <wk@gnupg.org> | 2007-11-22 17:24:21 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2007-11-22 17:24:21 +0100 |
commit | 95b57d93372e20893c792a2a55cb6468aab9b78a (patch) | |
tree | 22a99066dd79bb86402c42ef4e408b3728d9dc8b /sm | |
parent | Document --auto-issuer-key-retrieve. (diff) | |
download | gnupg2-95b57d93372e20893c792a2a55cb6468aab9b78a.tar.xz gnupg2-95b57d93372e20893c792a2a55cb6468aab9b78a.zip |
New command GETAUDITLOG
Diffstat (limited to 'sm')
-rw-r--r-- | sm/ChangeLog | 5 | ||||
-rw-r--r-- | sm/server.c | 36 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog index c033c3811..20f2866b1 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -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> * server.c (cmd_recipient, cmd_signer): Add error reason 11. diff --git a/sm/server.c b/sm/server.c index df0005b94..beab14284 100644 --- a/sm/server.c +++ b/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 }, { "GENKEY", cmd_genkey }, { "DELKEYS", cmd_delkeys }, + { "GETAUDITLOG", cmd_getauditlog }, { NULL } }; int i, rc; |