From eeed44617b8b2bf4c941f6de334a9006804615fb Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 23 Feb 2022 00:35:41 +0100 Subject: Don't assume Net::IMAP::InterIMAP is always in @INC. And make the installation path configurable at `make` time. Moreover, adjust the 'test' target so the site directory and interimap/pullimap path are configurable with INTERIMAP_I and INTERIMAP_PATH respectively. That way one can run `tests/run foo` to check the source, `make test` to check what's been built, and we also have the possibility to check the installed program e.g. for autopkgtests. --- interimap | 1 + 1 file changed, 1 insertion(+) (limited to 'interimap') diff --git a/interimap b/interimap index 7525f9f..9ba5d06 100755 --- a/interimap +++ b/interimap @@ -32,6 +32,7 @@ use DBD::SQLite::Constants ':file_open'; use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC/; use List::Util 'first'; +use lib "./lib"; use Net::IMAP::InterIMAP 0.5.6 qw/xdg_basedir read_config compact_set/; # Clean up PATH -- cgit v1.2.3 From 2447861913835637bbf49d96728ce9ac6ab0ae22 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 23 Feb 2022 22:30:45 +0100 Subject: interimap, pullimap: Ensure DB and statefiles are created with mode 0600. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It wasn't the case for interimap(1), see https://bugs.debian.org/608604 … Fortunately we create $XDG_DATA_HOME/interimap with a secure mode, but there is no reason to have the DB world-readable. Since we can't rely on SQLITE_OPEN_CREATE for secure mode we use sysopen(,,O_CREAT,0600). --- interimap | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'interimap') diff --git a/interimap b/interimap index 9ba5d06..d4ff3fc 100755 --- a/interimap +++ b/interimap @@ -29,7 +29,7 @@ use Getopt::Long qw/:config posix_default no_ignore_case gnu_compat bundling auto_version/; use DBI ':sql_types'; use DBD::SQLite::Constants ':file_open'; -use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC/; +use Fcntl qw/O_WRONLY O_CREAT O_EXCL F_GETFD F_SETFD FD_CLOEXEC/; use List::Util 'first'; use lib "./lib"; @@ -160,6 +160,12 @@ $SIG{TERM} = sub { cleanup(); exit 0; }; # Open (and maybe create) the database { + # don't auto-create in long-lived mode + unless ($CONFIG{watch} or -e $DBFILE) { + sysopen(my $fh, $DBFILE, O_WRONLY | O_CREAT | O_EXCL, 0600) or die "Can't create $DBFILE: $!"; + close $fh or warn "close: $!"; + } + my $dbi_data_source = "dbi:SQLite:dbname=".$DBFILE; my %dbi_attrs = ( AutoCommit => 0, @@ -167,8 +173,6 @@ $SIG{TERM} = sub { cleanup(); exit 0; }; sqlite_use_immediate_transaction => 1, sqlite_open_flags => SQLITE_OPEN_READWRITE ); - # don't auto-create in long-lived mode - $dbi_attrs{sqlite_open_flags} |= SQLITE_OPEN_CREATE unless defined $CONFIG{watch}; $DBH = DBI::->connect($dbi_data_source, undef, undef, \%dbi_attrs); $DBH->sqlite_busy_timeout(250); -- cgit v1.2.3 From 6b0010d82fe47b5f1f27084732431fb5b4ca0697 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 25 Feb 2022 01:04:32 +0100 Subject: Update copyright years. --- interimap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'interimap') diff --git a/interimap b/interimap index d4ff3fc..8b54013 100755 --- a/interimap +++ b/interimap @@ -2,7 +2,7 @@ #---------------------------------------------------------------------- # Fast bidirectional synchronization for QRESYNC-capable IMAP servers -# Copyright © 2015-2020 Guilhem Moulin +# Copyright © 2015-2022 Guilhem Moulin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.3 From 8ad5e5a218253a76eabf36bfd83f9e1a2a708377 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 27 Feb 2022 16:24:31 +0100 Subject: Prepare new release v0.5.7. --- interimap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'interimap') diff --git a/interimap b/interimap index 8b54013..ac9550f 100755 --- a/interimap +++ b/interimap @@ -22,7 +22,7 @@ use v5.14.2; use strict; use warnings; -our $VERSION = '0.5.6'; +our $VERSION = '0.5.7'; my $NAME = 'interimap'; my $DATABASE_VERSION = 1; use Getopt::Long qw/:config posix_default no_ignore_case gnu_compat @@ -33,7 +33,7 @@ use Fcntl qw/O_WRONLY O_CREAT O_EXCL F_GETFD F_SETFD FD_CLOEXEC/; use List::Util 'first'; use lib "./lib"; -use Net::IMAP::InterIMAP 0.5.6 qw/xdg_basedir read_config compact_set/; +use Net::IMAP::InterIMAP 0.5.7 qw/xdg_basedir read_config compact_set/; # Clean up PATH $ENV{PATH} = join ':', qw{/usr/bin /bin}; -- cgit v1.2.3