From: Eric Wong Date: Mon, 1 Aug 2022 21:24:44 +0000 (+0000) Subject: daemon: require absolute cert/key paths with --daemonize X-Git-Tag: v1.9.0~68 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3e6f8bf5a205fa1e0ad9d52cd13fa91f20f79018;p=public-inbox.git daemon: require absolute cert/key paths with --daemonize This is preparation for supporting loading new certs on SIGHUP. --- diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 0392d15f..87a359e7 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -66,6 +66,7 @@ sub accept_tls_opt ($) { my $host = ''; $path =~ s/\A([^:]+):// and $host = $1; $x->{$host} = $path; + check_absolute($k, $path) if $daemonize; } } my $ctx = IO::Socket::SSL::SSL_Context->new(%ctx_opt) or @@ -283,6 +284,8 @@ sub daemonize () { check_absolute('--stdout', $stdout); check_absolute('--stderr', $stderr); check_absolute('--pid-file', $pid_file); + check_absolute('--cert', $default_cert); + check_absolute('--key', $default_key); chdir '/' or die "chdir failed: $!"; }