]> git.cworth.org Git - notmuch/commitdiff
lib: check for writable db in n_m_tags_maildir_flags
authorDavid Bremner <david@tethera.net>
Wed, 25 May 2022 10:51:17 +0000 (07:51 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 25 Jun 2022 19:06:34 +0000 (16:06 -0300)
The database needs to be writable because the list of stored file
names will change in general.

lib/message.cc
test/T566-lib-message.sh

index e2069123db4f6547dfc4cde955300088fd15b9c5..1c87f8c0c2eb16ecb6b0f372f22e01072ff4fcae 100644 (file)
@@ -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);
index 87e70441c95edec553b1fded906ffaaed1e15270..511d56ca694e5c131d4d5815ad43d3e80ee5fbb1 100755 (executable)
@@ -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;