• Login hangs for 20+ seconds due to permissions issues

    From Nigel Reed@VERT to GitLab issue in main/sbbs on Mon Nov 23 15:37:21 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1411
    2026-11-23 15:37:21 -0800

    I noticed when logging into my BBS, it was hanging for over 20 seconds between saying the sysop is available or not and asking if I want to check for new mail.

    After investigating, I tracked it down to my /sbbs/data/msgs/0001.msg ownership being changed to root:root. The system didn't have write access to the file.

    I would suggest maybe checking permissions to ensure that the file has write permissions rather than hanging for 20 seconds and flag it as an error or something?

    Thanks.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Nov 23 16:55:07 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1411#note_11373

    Reproduced. The 20+ seconds is the file-open retry loop.

    At logon, the short messages (telegrams) waiting for you are read from `data/msgs/<user#>.msg`, which is opened for read/write so it can be emptied afterwards. With the file owned by root, that open fails with "Permission denied" (`EACCES`), and Synchronet's file-open routine treats `EACCES` as worth retrying: 100 attempts with a growing delay, about 28 seconds in all. After that it gives up **without logging anything**, so the telegrams are neither shown nor cleared, and the same delay repeats at every logon until the ownership is fixed.

    `EACCES` is retried for Windows' sake: there, a file another process has open with a conflicting share mode also fails with `EACCES`. On Linux/*nix, an `EACCES` from `open()` is always a permissions problem, so retrying it only adds the delay.

    Measured with `system.get_telegram()` on a telegram file the BBS can't write (both on local disk and through a CIFS/Samba mount): 27.9 seconds before the change, 0.05 to 0.07 seconds after. A file that is merely **locked** by another process is still waited for and then read, as before.

    The change (prepared and tested, not yet committed):

    - On non-Windows systems, a failed file open is no longer retried for `EACCES`. A lock conflict is still retried: the open routine now reports a conflicting `fcntl()` lock as `EAGAIN` (POSIX allows either), so `EACCES` from it means a permission error. Read/write retries are unchanged: through a CIFS mount, a Windows-style lock conflict on `read()`/`write()` also comes back as `EACCES`, and those still need retrying.
    - When the waiting telegrams can't be read, the Terminal Server now logs an error naming the file and the reason (e.g. `ERROR 13 (Permission denied)`), as suggested.

    How the file became `root:root`: a file gets root ownership when a process running as root **creates** it, so something (likely a script or `jsexec` run as root) sent user #1 a telegram at a time when `0001.msg` didn't exist.

    _Authored by Claude (Claude Code), on behalf of @rswindell_

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab issue in main/sbbs on Mon Nov 23 19:55:25 2026
    close https://gitlab.synchro.net/main/sbbs/-/work_items/1411
    2026-11-23 19:55:23 -0800

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