• src/sbbs3/bat_xfer.cpp

    From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sun Jun 6 00:04:44 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/b417647b95c4fa921624034c
    Modified Files:
    src/sbbs3/bat_xfer.cpp
    Log Message:
    Check batch-uploaded filenames for illegal characters/sequences/namesThe BadFilename text.dat is now a format string (prints the bad filename).Use the nice progress() display status while searching for duplicate filenames.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Thu Jun 10 13:27:44 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/0c5c140eceeb8012a8083f6a
    Modified Files:
    src/sbbs3/bat_xfer.cpp
    Log Message:
    Call smb_freefilemem() instead of smb_msgmem() for filesNot that it really matters, but perhaps it'll matter in the future. And the code reads better.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sat Oct 23 10:06:56 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/7dc1bc798e5a06e2278711ea
    Modified Files:
    src/sbbs3/bat_xfer.cpp
    Log Message:
    Fix segfault after batch-upload when no "uploads" dir specifiedWhen there's no "uploads" directory configured by the sysop, cfg.upload_dir will be set to INVALID_DIR, which cannot be used as an index into cfg.dir[] to determine if the time used for uploading the files should be "given back" to the user.In v3.18, we used the first file in the upload queue, if there was one, else fell back to the "uploads" dir (which had to have been defined if there were no files in the queue). So this illegal array indexing was a regression in v3.19.Reported by Zoltán Gábor on Facebook
    --- SBBSecho 3.14-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 Sun Sep 20 04:50:42 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d886b0623c88271819b82af2
    Modified Files:
    src/sbbs3/bat_xfer.cpp
    Log Message:
    Widen the batch-download list's quoting the same way, too

    7173641281 (statute-19-nobody, 2026-09-20) widened quoted_string() from "contains a space" to SHELL_QUOTE_CHARS in filedat.c and xtrn.cpp, but bat_xfer.cpp has a third copy that builds the space-separated list of
    paths %s expands to on a batch-download command line. It still quoted
    on a space alone, and %s is substituted verbatim -- it never goes
    through QUOTED_STRING -- so that copy is the only quoting on the path.

    That matters because the double-quote this function adds is itself one
    of the characters external() looks for when deciding to run the command
    through a shell. So one queued filename containing a space sends the
    whole command line through sh, and any other queued filename containing
    &, (, ), ', =, ^, [, ], {, } or # arrives unquoted. All of those are
    legal in an uploaded filename under the default Most ASCII setting;
    they're in SHELL_QUOTE_CHARS precisely because ILLEGAL_FILENAME_CHARS
    doesn't cover them.

    Demonstrated with a queue of "big game (1).zip", "rock&roll.zip" and "issue#7.zip": the shell took the & as a control operator, so the
    protocol received "rock" as its second argument and the third file was
    dropped along with the rest of the truncated command.

    Not reachable from a stock configuration, where every batch-download
    command line uses the list-file form @%f and the only entry using %s is
    Local Copy, a JavaScript module that never sees a shell. It needs a sysop-configured protocol that passes %s.

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