From 280a222553ed75ec36b2e2f81d8d5889f9b77e9d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 22 Oct 2004 09:39:47 +0000 Subject: [PATCH] (parse_rereadable_options): Return "not handled" when the log file has not beend hadled. This is will let the main option processing continue. Fixed a bug introduced on 2004-09-4 resulting in logging to stderr until a HUP has been given. (main): Don't close the listen FD. --- agent/ChangeLog | 8 ++++++++ agent/gpg-agent.c | 12 +++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/agent/ChangeLog b/agent/ChangeLog index b65e7b1de..756711f1a 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,11 @@ +2004-10-22 Werner Koch + + * gpg-agent.c (parse_rereadable_options): Return "not handled" + when the log file has not beend hadled. This is will let the main + option processing continue. Fixed a bug introduced on 2004-09-4 + resulting in logging to stderr until a HUP has been given. + (main): Don't close the listen FD. + 2004-09-30 Werner Koch * Makefile.am: Adjusted from gettext 1.14. diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 4e3f0b507..d3d628766 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -166,7 +166,7 @@ static char *config_filename; static const char *debug_level; /* Keep track of the current log file so that we can avoid updating - the log file afte a SIGHUP if id didn't changed. Malloced. */ + the log file after a SIGHUP if it didn't changed. Malloced. */ static char *current_logfile; /* Local prototypes. */ @@ -362,9 +362,10 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread) case oDebugLevel: debug_level = pargs->r.ret_str; break; case oLogFile: - if (reread - && (!current_logfile || !pargs->r.ret_str - || strcmp (current_logfile, pargs->r.ret_str))) + if (!reread) + return 0; /* not handeld */ + if (!current_logfile || !pargs->r.ret_str + || strcmp (current_logfile, pargs->r.ret_str)) { log_set_file (pargs->r.ret_str); xfree (current_logfile); @@ -416,6 +417,7 @@ main (int argc, char **argv ) int gpgconf_list = 0; gpg_error_t err; + set_strusage (my_strusage); gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN); /* Please note that we may running SUID(ROOT), so be very CAREFUL @@ -861,7 +863,7 @@ main (int argc, char **argv ) /* Close stdin, stdout and stderr unless it is the log stream */ for (i=0; i <= 2; i++) { - if (!log_test_fd (i) ) + if (!log_test_fd (i) && i != fd ) close (i); } if (setsid() == -1)