aboutsummaryrefslogtreecommitdiffstats
path: root/lacme
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-24 21:01:12 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-24 21:32:01 +0100
commitc612a7ff44995f4f9c39fa0fb68470d90c88decf (patch)
tree4b0a3fd2c44dbc25653a93b7ec692a003f0e133b /lacme
parentcdd025133a306cd8d3e81aa832ac056119d65f3a (diff)
lacme: Default mode for certificate(-chain) creation is 0644 minus umask restrictions.
Also, always spawn the client with umask 0022 so a starting lacme(8) with a restrictive umask doesn't impede serving challenge response files.
Diffstat (limited to 'lacme')
-rwxr-xr-xlacme1
1 files changed, 1 insertions, 0 deletions
diff --git a/lacme b/lacme
index 2366830..9012890 100755
--- a/lacme
+++ b/lacme
@@ -581,6 +581,7 @@ sub acme_client($@) {
set_FD_CLOEXEC($client, 1);
my $rv = spawn({in => $args->{in}, out => $args->{out}, child => sub() {
drop_privileges($conf->{user}, $conf->{group}, $args->{chdir} // '/');
+ umask(0022) // die;
set_FD_CLOEXEC($_, 0) foreach ($CONFFILE, $client);
seek($CONFFILE, SEEK_SET, 0) or die "seek: $!";
$ENV{DEBUG} = $OPTS{debug} // 0;