]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-init
add filter for Subject: tags
[public-inbox.git] / script / public-inbox-init
index 739ec9e55530c3dacdc3c6e9e33df6b099e474a6..e23d14199fda60637efd65de271a74ed35dc384b 100755 (executable)
@@ -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 $/;