• src/sbbs3/answer.cpp ftpsrvr.cpp js_system.cpp login.cpp mailsrvr.cpp

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu Oct 29 00:11:10 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/7ecf0b07863637a1259ec7fc
    Modified Files:
    src/sbbs3/answer.cpp ftpsrvr.cpp js_system.cpp login.cpp mailsrvr.cpp services.cpp userdat.c userdat.h websrvr.cpp
    Log Message:
    Report a failed user lookup as an error, not as an unknown user

    matchuser() and finduserstr() returned 0 both when no user matched and
    when name.dat or user.tab could not be opened or read, and
    find_login_id() passed that through. Every authenticating server then
    treated a lookup that never ran as a bad login: it logged "UNKNOWN
    USER" (with the password when Echo Password is on), counted a failed
    attempt against the client, and at the filter threshold banned its IP.
    The SMTP recipient lookup bounced mail with a permanent 550 the same
    way. A short read of name.dat returned a bogus user number.

    The scanning bodies are now matchuser_ex() and finduserstr_ex(), which
    return a USER_* error code when the user base could not be searched; matchuser() and finduserstr() clamp that to 0 so their other callers
    and system.matchuser() are unchanged. find_login_id() propagates the
    error, and system.find_login_id() clamps it for scripts. The login
    paths in the mail, FTP, web, Services and terminal servers log the
    error at LOG_ERR and answer with a temporary failure (-ERR [SYS/TEMP],
    454 4.7.0, 451 4.3.0, 421) without calling badlogin(); the SSH path no
    longer starts new-user registration on one.

    Seen on vert on 2026-10-27 when a handle leak (c42d0dc07c) exhausted
    the process's stdio streams: for four hours every real login was
    reported as an unknown user and a mail client retrying a valid
    account was banned for 90 days. Closes #1307.

    Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

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