From 84b6169de761ddd41be04d4cb8b9fa79fd73cdce Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 19 Dec 2001 00:18:11 +0000 Subject: [PATCH] assuan/ 2001-12-14 Marcus Brinkmann * assuan-buffer.c (_assuan_read_line): New variable ATTICLEN, use it to save the length of the attic line. Rediddle the code a bit to make it more clear what happens. agent/ 2001-12-19 Marcus Brinkmann * query.c (start_pinentry): Add new argument to assuan_pipe_connect. sm/ 2001-12-19 Marcus Brinkmann * call-agent.c (start_agent): Add new argument to assuan_pipe_connect. --- agent/ChangeLog | 4 ++++ agent/query.c | 2 +- assuan/ChangeLog | 6 ++++++ assuan/assuan-connect.c | 17 ++++++++++++++--- sm/ChangeLog | 4 ++++ sm/call-agent.c | 2 +- 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/agent/ChangeLog b/agent/ChangeLog index f34849a72..288953dfd 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,7 @@ +2001-12-19 Marcus Brinkmann + + * query.c (start_pinentry): Add new argument to assuan_pipe_connect. + 2001-12-18 Werner Koch * Makefile.am: Use LIBGCRYPT macros diff --git a/agent/query.c b/agent/query.c index 98a5b2639..9195f0ab4 100644 --- a/agent/query.c +++ b/agent/query.c @@ -84,7 +84,7 @@ start_pinentry (void) argv[1] = NULL; /* connect to the pinentry and perform initial handshaking */ - rc = assuan_pipe_connect (&ctx, opt.pinentry_program, (char**)argv); + rc = assuan_pipe_connect (&ctx, opt.pinentry_program, (char**)argv, 0); if (rc) { log_error ("can't connect to the PIN entry module: %s\n", diff --git a/assuan/ChangeLog b/assuan/ChangeLog index f85e22042..911fa983c 100644 --- a/assuan/ChangeLog +++ b/assuan/ChangeLog @@ -1,3 +1,9 @@ +2001-12-14 Marcus Brinkmann + + * assuan-buffer.c (_assuan_read_line): New variable ATTICLEN, use + it to save the length of the attic line. + Rediddle the code a bit to make it more clear what happens. + 2001-12-14 Werner Koch * assuan-listen.c (assuan_close_input_fd): New. diff --git a/assuan/assuan-connect.c b/assuan/assuan-connect.c index 683c7f060..613b54a13 100644 --- a/assuan/assuan-connect.c +++ b/assuan/assuan-connect.c @@ -71,9 +71,11 @@ writen ( int fd, const char *buffer, size_t length ) /* Connect to a server over a pipe, creating the assuan context and returning it in CTX. The server filename is NAME, the argument - vector in ARGV. */ + vector in ARGV. FD_CHILD_LIST is a -1 terminated list of file + descriptors not to close in the child. */ AssuanError -assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[]) +assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[], + int *fd_child_list) { static int fixed_signals = 0; AssuanError err; @@ -149,7 +151,16 @@ assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[]) n = MAX_OPEN_FDS; for (i=0; i < n; i++) { - if (i != fileno (stderr) + int *fdp = fd_child_list; + + if (fdp) + { + while (*fdp != -1 && *fdp != i) + fdp++; + } + + if (!(fdp && *fdp != -1) + && i != fileno (stderr) #ifdef HAVE_JNLIB_LOGGING && i != log_fd #endif diff --git a/sm/ChangeLog b/sm/ChangeLog index 654b4e93c..e9b8bfad4 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -1,3 +1,7 @@ +2001-12-19 Marcus Brinkmann + + * call-agent.c (start_agent): Add new argument to assuan_pipe_connect. + 2001-12-18 Werner Koch * verify.c (print_integer_sexp): Renamed from print_integer and diff --git a/sm/call-agent.c b/sm/call-agent.c index 6952e22f7..bbabe8352 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -163,7 +163,7 @@ start_agent (void) argv[2] = NULL; /* connect to the agent and perform initial handshaking */ - rc = assuan_pipe_connect (&ctx, opt.agent_program, (char**)argv); + rc = assuan_pipe_connect (&ctx, opt.agent_program, (char**)argv, 0); if (rc) { log_error ("can't connect to the agent: %s\n", assuan_strerror (rc));