about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm3
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,