]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Msgmap.pm
ensure SQLite and Xapian files respect core.sharedRepository
[public-inbox.git] / lib / PublicInbox / Msgmap.pm
index ec3d4f9d8101fe0e226895207f2a486016e8a223..6e758c1aa789d19951829ef5e7f4262751c518e7 100644 (file)
@@ -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,