mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* certdump.c (print_dn_part): Always print a leading slash,
removed NEED_DELIM arg and changed caller. * export.c (gpgsm_export): Print LFs to FP and not stdout. (print_short_info): Ditto. Make use of gpgsm_print_name. * server.c (cmd_export): Use output-fd instead of data lines; this was actually the specified way.
This commit is contained in:
parent
640688c4e2
commit
5c5a3f689a
5 changed files with 53 additions and 49 deletions
21
sm/server.c
21
sm/server.c
|
@ -443,12 +443,13 @@ static int
|
|||
cmd_export (ASSUAN_CONTEXT ctx, char *line)
|
||||
{
|
||||
CTRL ctrl = assuan_get_pointer (ctx);
|
||||
FILE *fp = assuan_get_data_fp (ctx);
|
||||
int fd = assuan_get_output_fd (ctx);
|
||||
FILE *out_fp;
|
||||
char *p;
|
||||
STRLIST list, sl;
|
||||
|
||||
if (!fp)
|
||||
return set_error (General_Error, "no data stream");
|
||||
if (fd == -1)
|
||||
return set_error (No_Output, NULL);
|
||||
|
||||
/* break the line down into an STRLIST */
|
||||
list = NULL;
|
||||
|
@ -473,8 +474,20 @@ cmd_export (ASSUAN_CONTEXT ctx, char *line)
|
|||
}
|
||||
}
|
||||
|
||||
gpgsm_export (ctrl, list, fp);
|
||||
out_fp = fdopen ( dup(fd), "w");
|
||||
if (!out_fp)
|
||||
{
|
||||
free_strlist (list);
|
||||
return set_error (General_Error, "fdopen() failed");
|
||||
}
|
||||
|
||||
gpgsm_export (ctrl, list, out_fp);
|
||||
fclose (out_fp);
|
||||
free_strlist (list);
|
||||
/* close and reset the fd */
|
||||
close_message_fd (ctrl);
|
||||
assuan_close_input_fd (ctx);
|
||||
assuan_close_output_fd (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue