• Kevin J. McCarthy's avatar
    Use a different flag in mx_open_mailbox_append() when mailbox doesn't exist. · 9ff7dfc1
    Kevin J. McCarthy authored
    The previous commit re-used MUTT_NEWFOLDER, but the meaning of that
    flag is slightly different: it causes mbox to use fopen with mode "w",
    and is used only for the case of a brand-new mktemp-generated mbox.
    Setting it for other non-existing mbox files leads to a race condition
    between the stat and the fopen/lock, and so could end up truncating an
    existing mailbox created in-between!
    Create a different flag, MUTT_APPENDNEW to notify the open_append()
    functions that the mailbox doesn't exist.  Change maildir and mh to
    check for that flag to create their directory structures.
mailbox.h 3.15 KB