Re: Bug: SIGABRT if "notmuch dump" output file is not writeable

Subject: Re: Bug: SIGABRT if "notmuch dump" output file is not writeable

Date: Tue, 23 Jul 2019 15:53:42 -0300

To: Ralph Seichter, notmuch@notmuchmail.org

Cc:

From: David Bremner


Ralph Seichter <abbot@monksofcool.net> writes:

> gzclose_w(output) has already been called in line 332, before Notmuch
> attempts to rename the temp file to the output file. At that point,
> 'output' should be set to null as it is being checked later, but that
> erroneously only happens in case the close operation fails.
>
> The rename in line 341 fails because of permission/ownership issues,
> 'ret' contains the error code for that, 'output' is still non-null, so
> gzclose_w is called again -- ergo boom.

That sounds plausible to me. Thanks for thinking about this longer than
I did. I'll be happy to look at a patch.

d
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: