• src/sbbs3/userdat.c

    From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Mon Nov 9 17:12:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/b643ac2bca589181742b3e75
    Modified Files:
    src/sbbs3/userdat.c
    Log Message:
    logoutuserdat(): unlock the user record before closing the file

    Since 48922a15c6 (2025-12-17), logoutuserdat() has read the user record
    with leave_locked=true, written it with fputuserdat(), and closed the file without unlocking the record, relying on close() to release the lock. Every other user record writer unlocks explicitly.

    On Windows, the release of a byte-range lock still held at close happens whenever the OS gets to it (Microsoft's LockFileEx documentation recommends
    an explicit unlock). The web server calls logoutuserdat() after nearly every authenticated request, so a webv4 user firing parallel requests could leave their record locked long enough for the other request threads to exhaust
    their lock retries and log "!Error -104 writing user data for user #N".
    On Vertrauen's Windows web server, every request from one such user stalled
    for about two minutes before failing this way.

    That commit also dropped the dirtyuserdat() call that the previous putuserstr()/adjustuserval() writes had performed; restore it.

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