• docs/v322_new.md src/sbbs3/smbutil.c

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Tuesday, September 15, 2026 20:47:46
    https://gitlab.synchro.net/main/sbbs/-/commit/aee485f478d18bf1aa97cb59
    Modified Files:
    docs/v322_new.md src/sbbs3/smbutil.c
    Log Message:
    smbutil: make pack error-safe

    packmsgs() renames the live .shd/.sdt/.sid aside before building their replacements, and three failure paths afterwards took a bare return with
    no message at all. A single unreadable message therefore left the base
    with no .shd, which a message server then treats as a base to create from scratch.

    Log those failures with the offending message number, skip a message
    whose data cannot be read rather than abandoning the pack, and restore
    the originals on any failure after the rename. The allocation tables are
    moved aside rather than truncated in place so that rollback is complete: against an emptied .sda, the next message written would land on top of
    live data. The replacements are flushed and checked before the swap, so a
    full disk no longer installs a truncated base, and the swap is now the
    last thing done rather than interleaved with the removals.

    Also stop discarding messages whose data exceeds 16MB. That limit was
    arbitrary and dropped the message from the base rather than leaving it uncompacted; the bound is now the format's own SMB_MAX_DAT_LEN.

    issue #1171

    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 Thursday, November 19, 2026 09:38:57
    https://gitlab.synchro.net/main/sbbs/-/commit/b17526d9ed681dec30a638aa
    Modified Files:
    docs/v322_new.md src/sbbs3/smbutil.c
    Log Message:
    smbutil: test pack's header allocation result before offsetting it

    Pack added the base's header offset to smb_fallochdr()'s return value
    before testing it for an error. With the usual header offset (32) the
    sum stayed negative, so the message was still skipped but the error
    was logged with the wrong code (e.g. -70 for SMB_ERR_HDR_OFFSET,
    -102). A base with a header offset larger than the error code's
    magnitude would have had the failure go unnoticed and the header
    written at a bogus offset. The header offset is now added only to a
    successful allocation.

    Also note the allocation and chksmb fixes in the v3.22 release notes.

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

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