Creating config 0600 disregarding umask breaks scenarios where daemons
run with credentials different from config owner (but need to read the
config).
Fixed in the next commit.
---
t/init.t | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/t/init.t b/t/init.t
index 0096ca307962..82a2a4436261 100644
--- a/t/init.t
+++ b/t/init.t
@@ -19,7 +19,11 @@ sub quiet_fail {
my $cfgfile = "$ENV{PI_DIR}/config";
my $cmd = [ '-init', 'blist', "$tmpdir/blist",
qw(http://example.com/blist [email protected]) ];
+ my $umask = umask(070) // xbail "umask: $!";
ok(run_script($cmd), 'public-inbox-init OK');
+ umask($umask) // xbail "umask: $!";
+ my $mode = (stat($cfgfile))[2];
+ is(sprintf('0%03o', $mode & 0777), '0604', 'config respects umask');
is(read_indexlevel('blist'), '', 'indexlevel unset by default');
base-commit: a036772bdf732d4779f44974095bfdd0b30271ef
prerequisite-patch-id: ae82f21759a714a6b09181e43d7188ce161b0838
prerequisite-patch-id: 2e5b084feebccfac20ec7229d44f752a03378ce1
prerequisite-patch-id: f448c88e715000bd71f3728f4b41cc36966765e6
prerequisite-patch-id: 417d67853ab35049abd2be97e8ce6850397053f2
prerequisite-patch-id: 2b3a925b08e3c5d032536f81d7e899893da6247b
--
2.42.0