From fef888045bfd03c26822782411ff835c03440d58 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 22 Feb 2021 00:28:02 +0100 Subject: logfile: treat empty values as unset. --- lacme-accountd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lacme-accountd') diff --git a/lacme-accountd b/lacme-accountd index a842bce..9ed41c4 100755 --- a/lacme-accountd +++ b/lacme-accountd @@ -119,10 +119,10 @@ do { print STDERR "Using configuration file: $conffile\n" if $OPTS{debug}; my $h = Config::Tiny::->read($conffile) or error(Config::Tiny::->errstr()); my $h2 = delete $h->{_} // {}; - if (defined (my $logfile = $h2->{logfile})) { + if ((my $logfile = $h2->{logfile} // "") ne "") { $logfile = spec_expand($logfile); die "Invalid log file name\n" unless $logfile =~ /\A(\p{Print}+)\z/; # untaint - open $LOG, ">>", $1 or die "Can't open $1: $!"; + open $LOG, ">>", $1 or die "Can't open $1: $!"; # open ASAP (before config validation) } error("Invalid section(s): ".join(', ', keys %$h)) if %$h; my %h = map { $_ => delete $h2->{$_} } qw/privkey gpg socket logfile keyid quiet/; -- cgit v1.2.3