diff options
author | Eric Wong <e@80x24.org> | 2018-04-18 23:27:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-04-18 23:40:52 +0000 |
commit | 2a353273079b2491cbceb20526d3c9dbf43d8f62 (patch) | |
tree | e84d1b4f39fbb63231c8b3585d14bcd1a7240136 /lib/PublicInbox/Msgmap.pm | |
parent | cfb8d16578e7f2f2e300f9f436205e4a8fc7f322 (diff) | |
download | public-inbox-2a353273079b2491cbceb20526d3c9dbf43d8f62.tar.gz |
We can't have files with permissions inconsistent with what's in git objects.
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r-- | lib/PublicInbox/Msgmap.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index ec3d4f9d..6e758c1a 100644 --- a/lib/PublicInbox/Msgmap.pm +++ b/lib/PublicInbox/Msgmap.pm @@ -26,6 +26,9 @@ sub new { sub dbh_new { my ($f, $writable) = @_; + if ($writable && !-f $f) { # SQLite defaults mode to 0644, we want 0666 + open my $fh, '+>>', $f or die "failed to open $f: $!"; + } my $dbh = DBI->connect("dbi:SQLite:dbname=$f",'','', { AutoCommit => 1, RaiseError => 1, |