From a3391407c960e4bbd825a34b87d053de6ef3767a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 28 Jul 2020 22:11:32 +0000 Subject: v2writable: use {inboxdir} for msgmap->tmp_clone Otherwise, a user is more likely to remove the msgmap-XXXXXXXX SQLite file from $TMPDIR and cause SQLite to error out. --- lib/PublicInbox/Msgmap.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Msgmap.pm') diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index 839ddf7c..51b6a68c 100644 --- a/lib/PublicInbox/Msgmap.pm +++ b/lib/PublicInbox/Msgmap.pm @@ -48,8 +48,8 @@ sub new_file { # used to keep track of used numeric mappings for v2 reindex sub tmp_clone { - my ($self) = @_; - my ($fh, $fn) = tempfile('msgmap-XXXXXXXX', EXLOCK => 0, TMPDIR => 1); + my ($self, $dir) = @_; + my ($fh, $fn) = tempfile('msgmap-XXXXXXXX', EXLOCK => 0, DIR => $dir); my $tmp; if ($self->{dbh}->can('sqlite_backup_to_dbh')) { $tmp = ref($self)->new_file($fn, 2); -- cgit v1.2.3-24-ge0c7