(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.
This commit is contained in:
Werner Koch 2004-10-22 09:39:47 +00:00
parent c5487b7982
commit 280a222553
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2004-10-22 Werner Koch <wk@g10code.com>
* 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 <wk@g10code.com>
* Makefile.am: Adjusted from gettext 1.14.

View File

@ -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)