aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-22 00:28:02 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-22 00:32:26 +0100
commitfef888045bfd03c26822782411ff835c03440d58 (patch)
treef33da84574971b818e53cf5b0e4ce68f152cd3b7
parent3d7cbb119cae717e0a3e5546d9a2b6ae982c514b (diff)
logfile: treat empty values as unset.
-rwxr-xr-xlacme-accountd4
1 files changed, 2 insertions, 2 deletions
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/;