From 6f749dd24a1c8138a05ac92884e8cb71098c7f6e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 25 May 2022 07:51:17 -0300 Subject: [PATCH] lib: check for writable db in n_m_tags_maildir_flags The database needs to be writable because the list of stored file names will change in general. --- lib/message.cc | 4 ++++ test/T566-lib-message.sh | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/message.cc b/lib/message.cc index e2069123..1c87f8c0 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -2039,6 +2039,10 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message) char *to_set, *to_clear; notmuch_status_t status = NOTMUCH_STATUS_SUCCESS; + status = _notmuch_database_ensure_writable (message->notmuch); + if (status) + return status; + _get_maildir_flag_actions (message, &to_set, &to_clear); for (filenames = notmuch_message_get_filenames (message); diff --git a/test/T566-lib-message.sh b/test/T566-lib-message.sh index 87e70441..511d56ca 100755 --- a/test/T566-lib-message.sh +++ b/test/T566-lib-message.sh @@ -375,7 +375,6 @@ EOF test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "Handle converting tags to maildir flags with closed db" -test_subtest_known_broken cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} { notmuch_status_t status;