• docs/v322_new.md exec/tes

    From Rob Swindell (on Windows@VERT to Git commit to main/sbbs/m on Sun Sep 20 23:06:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/17981f079f919fc563891aa9
    Modified Files:
    docs/v322_new.md exec/tests/file/popen.js src/sbbs3/js_file.cpp src/xpdev/genwrap.c genwrap.h
    Log Message:
    File.popen() on Windows, and bidirectionally on every platform

    The File object's pipe support has been Unix-only since it was added in 06ee2c71fb: on Windows, C's _popen() requires the calling process to own
    a console, which a service or anything launched by sbbsctrl.exe does not.
    Its documented default mode narrowed that further -- "r+" is a BSD
    extension that glibc rejects with EINVAL, so the default has been failing
    on Linux and working only on FreeBSD and macOS.

    New in xpdev:

    xp_pipe_open() - popen() with the same three modes everywhere. On
    Windows, "r" and "w" get a CreatePipe() and a CREATE_NO_WINDOW child;
    "r+" gets a uniquely-named single-instance duplex named pipe, an
    anonymous one being one-way. Our end becomes a real FILE* through
    _open_osfhandle() and fdopen(), so File.read(), readln() and write()
    work against it unchanged. Elsewhere "r" and "w" still go through
    popen(), and "r+" gets a socketpair()-connected /bin/sh child, which is
    how the BSD popen() implements that mode.

    xp_pipe_close() - closes the stream first, so a command reading it sees
    EOF, then waits for it and returns its exit status.

    js_close() uses xp_pipe_close(), and so does the File finalizer, which
    until now fclose()d a pipe -- leaking the child process on every
    platform. The JSDOC drops "only functional on UNIX systems" and picks up
    the 'b' (binary) suffix and the flush()-between-write-and-read rule that
    any bidirectional stream needs.

    exec/tests/file/popen.js no longer exits early on Windows: it covers "r",
    the default "r+", "w" into a command whose output file must be complete
    once close() returns, and an unusable mode. The POSIX side was checked
    with gcc against a C harness over the same three modes, exit-status
    propagation and child reaping.

    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 L@VERT to Git commit to main/sbbs/m on Mon Oct 26 00:09:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/4365e08932e3ba60d0f41e58
    Modified Files:
    docs/v322_new.md exec/tests/qwkjob/hub.js pack.js src/sbbs3/qwk.cpp qwkjob.cpp qwkjob.h sbbs.h
    Log Message:
    qwkjob: take over a QWK lock left by a crashed holder after an hour

    The user (data/pack<user#>.lock), REP and hub (data/qnet/<HUBID>.lock)
    locks were taken with TIMEOUT_MUTEX_FILE (12 hours) as the fmutex maximum
    age. On POSIX a lock file outlives a holder that crashes, and these locks
    are now taken by the Web server, Services and jsexec too, so one crash
    left that user's or hub's QWK traffic refused for up to 12 hours, logged
    only at debug level.

    The jobs and the Terminal Server's QWK download and upload now take the
    locks with QWKJOB_LOCK_MAX_AGE (1 hour). A refusal is logged with the
    holder's text and how long the lock has been held, at LOG_NOTICE once that exceeds QWKJOB_LOCK_NOTICE_AGE (5 minutes), else at LOG_DEBUG. The event thread's hub call-out takes the lock through qwkjob_lock_hub(), so it
    logs the same way.

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

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Mon Oct 26 00:09:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/251c99b699627b5dbad0ad3b
    Modified Files:
    docs/v322_new.md exec/tests/qwkjob/hub.js src/sbbs3/nopen.c qwk.cpp qwkjob.cpp qwkjob.h
    Log Message:
    fmutex_close(): remove only our own lock file; hub lock ages out at 12 h

    fmutex_open() takes over a lock file older than its max_age, and nothing refreshes a lock's time stamp while it is held. fmutex_close() then
    unlinked by name, so a holder that outlived max_age removed the lock of
    the process that took it over, leaving the next job free to run beside
    it. On POSIX, fmutex_close() now unlinks only when the open descriptor and
    the named file have the same device and inode; a missing or different file
    is no longer ours and is left alone. The descriptor is now always closed:
    a failed unlink used to return early and leak it. (Windows deletes on
    close and is unchanged.)

    The QWKnet hub lock is held across the event thread's call-out, which can
    run longer than the hour that QWK job locks were given for a crashed
    holder. The hub lock goes back to 12 hours (QWKJOB_HUB_LOCK_MAX_AGE, as
    before the QWK job locks); the per-user and REP locks, held only for one
    pack or import, keep 1 hour (QWKJOB_USER_LOCK_MAX_AGE).

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

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Sat Nov 14 13:59:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/1fc7b3b579e137acec3b7f1e
    Modified Files:
    docs/v322_new.md exec/tests/test.js src/sbbs3/exec.cpp
    Log Message:
    Search mods and exec for relative ?script paths not found from ctrl

    A ?script command line (;EXEC, bbs.exec(), external program, editor and
    menu command lines) with a bare script name is searched for in the
    startup directory, mods and exec. A relative path containing a directory
    was only opened relative to the current directory, which is the ctrl
    directory, so ?tests/test.js failed even though exec/tests/test.js
    exists.

    Such a path is still tried relative to ctrl first, so every command line
    that resolved before resolves the same way (e.g. ?../xtrn/...). Only when
    it isn't found there is it searched for like a bare name: startup
    directory, then mods, then exec.

    The @-code test runner's usage comment now uses the short form:
    ;EXEC ?tests/test.js atcodes

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

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