aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pullimap/t
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2022-02-23 22:30:45 +0100
committerGuilhem Moulin <guilhem@fripost.org>2022-02-23 23:43:58 +0100
commit2447861913835637bbf49d96728ce9ac6ab0ae22 (patch)
tree4f865a799547eb6b2a6728de37e65a6f07665b4e /tests/pullimap/t
parent4d36557a007f06196affe14afd1a2bd2a4945c44 (diff)
interimap, pullimap: Ensure DB and statefiles are created with mode 0600.
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).
Diffstat (limited to 'tests/pullimap/t')
-rw-r--r--tests/pullimap/t7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/pullimap/t b/tests/pullimap/t
index 0dfe634..7998cdc 100644
--- a/tests/pullimap/t
+++ b/tests/pullimap/t
@@ -6,6 +6,13 @@ step_start "\`pullimap --idle\` refuses to create the state file"
! pullimap --idle "remote" || error
step_done
+step_start "\`pullimap\` creates statefile with mode 0600"
+pullimap "remote" || error
+if ! st="$(stat -c"%#a" -- "$XDG_DATA_HOME/pullimap/remote")" || [ "$st" != "0600" ]; then
+ error "$XDG_DATA_HOME/pullimap/remote has mode $st != 0600"
+fi
+step_done
+
# compare mailboxes (can't compare the RFC 3501 TEXT as the LMTPd inconditionally
# adds a Return-Path: header -- and also Delivered-To: and Received: to by default)
list_mails_sha256() {