• src/sbbs3/netmail.cpp

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Tue Sep 15 20:47:46 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/93e3598ffb0d8f368643561a
    Modified Files:
    src/sbbs3/netmail.cpp
    Log Message:
    Hold the SMB header lock across the QWK netmail data allocation

    sbbs_t::qwktonetmail() allocated message data storage without holding smb_locksmbhdr(). Every other allocation site takes it across the
    allocation; this one acquired it only indirectly, when smb_addmsghdr()
    locks internally some fifty lines later, by which point the data blocks
    had already been chosen and written.

    smb_allocdat() scans the .sda for a run of free blocks and only then
    writes their reference counts, so the window between choosing a run and claiming it spans the rest of the scan. Two writers allocating
    concurrently, one of them on this path, can settle on the same run and
    produce two messages whose data storage overlaps, which chksmb reports
    as duplicated or corrupt data records. Header allocation is unaffected,
    being done inside smb_addmsghdr() under the lock it takes itself.

    The window is far narrower under fast allocation, which seeks to EOF and
    claims the blocks immediately, so switching a mail base to that storage
    mode makes this class of error appear to stop without fixing it.

    issue #1241

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sun Nov 22 12:19:51 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/24a6eef87292c6e0d25057e8
    Modified Files:
    src/sbbs3/netmail.cpp
    Log Message:
    QWK netmail: close and remove a .msg file whose header was not written

    qwktonetmail() returned without closing the new netmail .msg file when
    writing its header failed, leaking the descriptor and leaving a .msg
    file without a header in the netmail directory. The "too many e-mails
    today" return also leaked the QWK message buffer.

    Coverity CID 662425.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net