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

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

Date: Mon, 08 Jun 2015 08:02:22 +0200

To: Morgan Veyret, notmuch@notmuchmail.org

Cc:

From: David Bremner


Morgan Veyret <morgan.veyret@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.


Thread: