• src/sbbs3/ftpsrvr.cpp

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Sun Feb 22 10:33:30 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/b795545afa5e0cc6250e0fb2
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    This is C++ now, value-initialize since we can't zero-initialize

    Same-same, but different, but still same.
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Fri Mar 6 23:49:36 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/83252750de3b2354f2039a18
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    Log better errors/warnings when upload directory doesn't exist

    or doesn't have enough free space
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sun Mar 8 19:24:52 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/815458f875915bbb4cfb2b18
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    s/Unallowed/Disallowed
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Fri Mar 20 01:30:04 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/bb760f2009bfc0b46c250c05
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    Fix the delete permissions flags in the MLST/MLSD support

    In commit d4deb4b3, the 'R' and 'D' restrictions were conflated.

    I just notice this in code review: the 'D' restriction has nothing to do with removing/deleting files.

    Also, a non-R-restricted user can delete any files they've uploaded.
    Fixed that too.
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sat May 2 18:58:14 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f28f210b217239031baa9af1
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    sbbs3 ftpsrvr: modernize legacy BOOL/TRUE/FALSE to bool/true/false

    Mechanical conversion across the file: function signatures, local
    variables (incl. volatile flags shared across xfer threads), xfer_t
    struct fields, and all literal arguments/comparisons. External callees (load_cfg, matchuser, getnodedat, wildmatchi, seteuid callback) already
    declare bool parameters, so no ABI change. Also collapse direxist()'s
    if/else to a single return.
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue May 5 15:55:24 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/8a7ff359a230d7820816acb5
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    Use int (32-bits) instead of bool (8-bits) for setsockopt(... REUSEADDR)

    Fix issue #1137 (bug introduced in commit f28f210b)
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue May 5 15:56:56 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f1f4ac3fce5a360a4f2446ed
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    Use int (32-bit) instead of bool (8-bit) for setsockopt(... NODELAY)

    Similar to fix for issue #1137
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wed May 6 22:36:56 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/769599ebba788f26253334f3
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    ftpsrvr: handle return values in send/receive_thread and sock_recvbyte (CIDs 643130, 643142, 643143)

    - send_thread/receive_thread: log a warning if fseeko to xfer.filepos
    fails so a seek error is no longer silent (downstream I/O would
    proceed at the wrong offset). Continues into the transfer loop
    either way to preserve existing behavior.
    - sock_recvbyte: cast the inner cryptSetAttribute (re-arming the read
    timeout) to void; this is best-effort and the matching call above
    it is already error-checked.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Wed May 20 16:55:04 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/3f0508da6bce06fb59f76358
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    ftpsrvr: fix file-descriptor leaks in directory/index handlers

    Two distinct leaks of per-command temp-file descriptors, both surfacing
    as "ERROR 24 (Too many open files)" once the process exhausts its
    descriptor table -- after which every temp-file open (LIST/MLSD .lst,
    index .ndx, QWK packets, and even unrelated subsystems sharing the
    process) fails in a storm.

    1) MDTM <index-file> (getdate) opened a temp .ndx file via ftp_tmpfname()
    but never closed it: the lone fclose(fp) lives only in the !getdate
    (download) branch. Every MDTM on the dynamically-generated index file
    (startup->index_file_name, e.g. 00index) leaked one descriptor and
    orphaned an sbbstemp/SBBS_FTP.*.ndx file. FTP clients and crawlers
    MDTM each listed entry, so these accumulated steadily.
    Fix: don't open the temp file for a getdate/MDTM request at all (it is
    only needed to generate listing content); move the fopen into the
    !getdate branch.
    Introduced in 63e5e08f1c (2007-02-11), which made the index fopen
    unconditional and added early-outs for SIZE (continue) and MDTM
    (fall-through) that both bypassed the fclose. ff9ae78f44 (2007-11-28)
    fixed the SIZE half by moving its check above the fopen, but left the
    MDTM path leaking -- for ~18 years.

    2) The MLSD, LIST and index-generation handlers "continue" out of the
    command loop on smb_open_dir() failure without closing the already-
    opened temp fp (and, for LIST/MLSD, without servicing the already-
    announced data connection). Triggers whenever a directory's .shd is
    locked or contended.
    Fix: close fp on the failure path; for LIST/MLSD also run the normal
    filexfer() cleanup so the data connection is serviced and the temp
    file removed.
    Introduced in 925e3b0a2 (2021-04-04), which migrated FTP directory
    listings to smb_open_dir()/loadfiles().

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wed May 20 17:10:12 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/19c8264107387b59dfe2dc70
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    ftpsrvr: add errprintf() and route LOG_ERR/LOG_CRIT through it for de-dup

    The FTP server logged every error via lprintf(LOG_ERR/LOG_CRIT, ...),
    which writes each record to error.log with no repeat suppression. Under file-descriptor exhaustion (EMFILE) a single busy server flooded
    error.log with thousands of near-identical entries.

    Mirror the mailsrvr/websrvr/services pattern: add a static errprintf()
    that calls repeated_error(line, function) and demotes a consecutive
    repeat of the same site to LOG_WARNING (which falls out of error.log).
    Convert all 48 LOG_ERR/LOG_CRIT lprintf() call sites to
    errprintf(..., WHERE, ...).

    This is log de-duplication only; it does not address the underlying
    descriptor exhaustion. Note repeated_error() tracks only the single
    most-recent (line, function), so interleaved failures from many
    concurrent sessions are only partially collapsed.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Thu May 21 20:23:04 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/308b735e39c6aaefec799fd0
    Modified Files:
    src/sbbs3/ftpsrvr.cpp
    Log Message:
    ftpsrvr: remove duplicate ndx temp-file fopen() from de-dup commit

    Commit 19c826410 ("add errprintf() and route LOG_ERR/LOG_CRIT through it
    for de-dup") was meant only to convert the index-file fopen() failure's lprintf(LOG_ERR,...) to errprintf(..., WHERE, ...). A rebase merge
    resolution instead inserted a second, redundant fopen() of the "ndx"
    temp file ahead of "success = true;" (giving the new copy the errprintf)
    while leaving the original lprintf() open untouched.

    That left two opens:
    - the getdate (MDTM-style) path opened a temp file it never uses --
    contradicting the "No temp file needed for a modification-time query"
    comment -- and never set tmpfile/delfile, leaking both the descriptor
    and the temp file (ironic in an EMFILE-motivated change);
    - the !getdate path opened the file twice, leaking the first descriptor.

    Drop the spurious block and keep the de-dup conversion on the surviving
    open inside the else branch, restoring the original single-open logic.

    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)