diff options
Diffstat (limited to 'script/public-inbox-init')
-rwxr-xr-x | script/public-inbox-init | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/script/public-inbox-init b/script/public-inbox-init index 739ec9e5..e23d1419 100755 --- a/script/public-inbox-init +++ b/script/public-inbox-init @@ -28,6 +28,11 @@ mkpath($dir); # will croak on fatal errors my ($fh, $filename) = tempfile('pi-init-XXXXXXXX', DIR => $dir); if (-e $pi_config) { open(my $oh, '<', $pi_config) or die "unable to read $pi_config: $!\n"; + my @st = stat($oh); + my $perm = $st[2]; + defined $perm or die "(f)stat failed on $pi_config: $!\n"; + chmod($perm & 07777, $fh) or + die "(f)chmod failed on future $pi_config: $!\n"; my $old; { local $/; |