• ctrl/web_alias.ini docs/v322_new.md src/sbbs3/websrvr.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wednesday, November 18, 2026 19:34:16
    https://gitlab.synchro.net/main/sbbs/-/commit/ea63fe0d0fa12a46563ec3cd
    Modified Files:
    ctrl/web_alias.ini docs/v322_new.md src/sbbs3/websrvr.cpp
    Log Message:
    websrvr: [dir] section of web_alias.ini serves a directory at a URL

    The web server serves only what is under its root directory, so a
    directory elsewhere could be served only through a link or a copy.
    A [dir] section in ctrl/web_alias.ini now maps a request-path prefix
    to a real directory, absolute or relative to ctrl:

    [dir]
    /webmail/ = ../webmail/root/

    Lines outside the section keep their meaning (request path to request
    path), and a file without the section behaves as before.

    A [dir] match takes precedence over the root-section aliases, the web
    root, virtual-host directories and file-area paths, for any host name;
    the longest key wins. An aliased request is confined to its directory
    by an exact containment test in place of the web-root test, and its
    webctrl.ini walk starts at the aliased directory, so the site root's webctrl.ini does not apply there. A bad key or a value that is not a
    directory is logged and ignored.

    The stock web_alias.ini gains a commented example and notes on what a
    [dir] directory serves; no alias is enabled by default.

    Tested with a script that runs the web server alone on a loopback port
    against a throwaway configuration: 23 checks, including four spellings
    of a "../" traversal and a sibling directory with the same name prefix
    (all refused), webctrl.ini enforcement, a virtual host, and a run with
    the section removed. Linux only; the traversal cases have not been run
    on Windows. Built with GCC only.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)