https://gitlab.synchro.net/main/sbbs/-/commit/c117c9984e3992c00847f118
Modified Files:
docs/v322_new.md src/sbbs3/bat_xfer.cpp filedat.c filedat.h inkey.cpp sbbsdefs.h src/sbbs3/scfg/scfgxfr1.c src/sbbs3/xtrn.cpp
Log Message:
Escape $ and back-tick in a quoted external command-line value on *nix
On Unix-like systems, external() runs any command line containing a double-quote through sh -c (since 8d87f55caf, alloy-22-wheat,
2003-03-01). So every value cmdstr() wraps in double-quotes reaches sh,
which still expands $(...), ${...} and back-ticks inside them. A file
whose name carries such an expansion, passed to a protocol driver,
viewer or tester as %f, ran that command as the BBS. By widening the
quoting trigger, 7173641281 (statute-19-nobody, 2026-09-20) made such
names reach sh even without a space.
Replace the three identical quoted_string() copies (filedat.c,
xtrn.cpp, bat_xfer.cpp) with one quoted_cmdarg(). When sh may parse the
line (a native *nix program; not a '?' JS or '*' Baja module, and not a
DOSEMU batch file) it backslash-escapes $, back-tick, " and \ inside the quotes, and any of them triggers the quoting. Windows and the module
paths are unchanged.
7173641281 also refused uploaded filenames containing $ or a back-tick.
Both are legal DOS and Windows filename characters, so such names reach
a file base anyway (old CD-ROM collections, TIC imports, FileBase.add(), uploads to a Windows instance sharing the file base). With the escaping
in place the refusal protects nothing; remove it, along with SHELL_EXPANSION_CHARS and its SCFG help line.
The batch download list is now quoted after the protocol is chosen,
since that decides whether sh will parse it. A '?' hot-key command is
passed to cmdstr() whole, so cmdstr() sees the '?' and doesn't
sh-escape a JavaScript module's arguments.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net