diff options
author | Eric Wong <e@80x24.org> | 2021-11-02 06:57:43 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-11-02 11:13:45 +0000 |
commit | bcc02b78e322f87d942459de874ba68b3fc06c39 (patch) | |
tree | c9c7e3961d07ac550fcaa4a01f57d3ab86dbb592 /t/init.t | |
parent | 2191edf5e099363a860e27d9e1b0f98ef51c6e59 (diff) | |
download | public-inbox-bcc02b78e322f87d942459de874ba68b3fc06c39.tar.gz |
I noticed a description for a new inbox had st_mode=0600.
Diffstat (limited to 't/init.t')
-rw-r--r-- | t/init.t | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -97,10 +97,16 @@ sub quiet_fail { $cmd = [ '-init', 'deep-non-existent', "$tmpdir/a/b/c/d", qw(http://example.com/abcd abcd@example.com) ]; $err = ''; + my $umask = umask(022) // xbail "umask: $!"; ok(run_script($cmd, $env, $rdr), 'initializes non-existent hierarchy'); + umask($umask) // xbail "umask: $!"; ok(-d "$tmpdir/a/b/c/d", 'directory created'); - is(PublicInbox::Inbox::try_cat("$tmpdir/a/b/c/d/description"), + my $desc = "$tmpdir/a/b/c/d/description"; + is(PublicInbox::Inbox::try_cat($desc), "public inbox for abcd\@example.com\n", 'description set'); + my $mode = (stat($desc))[2]; + is(sprintf('0%03o', $mode & 0777), '0644', + 'description respects umask'); open my $fh, '>', "$tmpdir/d" or BAIL_OUT "open: $!"; close $fh; |