From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CD2931F619 for ; Mon, 1 Aug 2022 21:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1659389087; bh=Px6iMUtY14VuqHvYcCz25J9bx75q25TsA/aEGuLsq8A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L1MOM3WtiXu2q8LXF65EiwlpCTc3/sFlXBMSdI8uHbOIC0oRuWudn13BdDbI0r0nA wHLwo7jbqsHDD7wbp6k54PA4wg0/8wMkokfJr7iFj3kviY7LILkJ4GtHDd/dyOFr0Y N0dzB98Bxxh8+9OcfvSrWGEjjnGkOYaVlzOCvieI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/6] daemon: require absolute cert/key paths with --daemonize Date: Mon, 1 Aug 2022 21:24:44 +0000 Message-Id: <20220801212447.270000-4-e@80x24.org> In-Reply-To: <20220801212447.270000-1-e@80x24.org> References: <20220801212447.270000-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This is preparation for supporting loading new certs on SIGHUP. --- lib/PublicInbox/Daemon.pm | 3 +++ 1 file changed, 3 insertions(+) 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: $!"; }