https://gitlab.synchro.net/main/sbbs/-/commit/f7c74bcbbff8fc3a314013d4
Modified Files:
src/sbbs3/ftpsrvr.cpp main.cpp services.cpp src/xpdev/multisock.c sockwrap.c sockwrap.h
Log Message:
Accept client sockets close-on-exec (#1174)
Listen sockets stopped being inherited by child processes in b96da4eb92 (forget-6-zone, 2026-08-07), but the sockets accepted from them were still handed to every external program, CGI and timed event this process spawns. Those do not pin a listening port, so they cannot produce the failed-rebind outage that started this, but one session's socket has no business in
another session's door.
xp_accept() wraps accept4(SOCK_CLOEXEC), falling back to accept() plus
fcntl() where the platform has no accept4() (macOS) or the kernel is too old for it. Used for the terminal, FTP data, and service sockets.
Deliberately not used for the node passthru socket in main.cpp: a native socket-door is handed that descriptor by number via the %H command-line specifier, so it is the one socket that has to survive exec. Noted at the
call site, since it otherwise looks like an omission.
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net