BUG: maildir flags sync with database relative path results in corrupted filename

David Bremner david at tethera.net
Sun Jun 7 23:02:22 PDT 2015


Morgan Veyret <morgan.veyret at gmail.com> writes:

>
> As I understand it's expected that the database path should be absolute but
> corrupting the database when the path is relative sounds dangerous.

Thanks for the report.  I can see how this could happen, since the
internal functions _notmuch_message_add_file_name and
_notmuch_database_relative_path classify message filenames into absolute
paths starting with the database path and paths relative to the database
root.

The obvious solution is to reject non-absolute paths in
notmuch_database_open_verbose. A slightly friendlier approach would be
to canonicalize the path, but this might have unforseen consequences for
clients relying on the database path being exactly what they pass in.

Can you see if the attached patch "fixes" it for you? You'll have to
rebuild notmuch from source. The patch should apply to 0.20 or later.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.diff
Type: text/x-diff
Size: 528 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20150608/1842a8b7/attachment.diff>


More information about the notmuch mailing list