Commit Graph
13 Commits
Author SHA1 Message Date
Brad Arant 1a15f6ced8 Add real authentication to ConsoleServer/ConsoleSession, fix CommandList help
ConsoleSession's login flow never actually checked anything: the
entered username was discarded and the password was never compared,
so any input (including blank) reached the command prompt. Confirmed
live via an unauthenticated login against BARANTMail's admin console
on port 1027, which was reachable externally. ConsoleServer now takes
an optional credentialChecker callback consulted by the WAIT_PASSWORD
state; omitting it preserves the old accept-anything behavior for any
other use of this class.

Separately, the console never prompted until the client's first line
arrived - that line was silently discarded just to kick the state
machine off, shifting every subsequent line one slot early. Harmless
under the old accept-anything login, but it broke real credential
checking outright (the typed password was compared against the typed
username, etc). ConsoleSession::onConnected() now starts the state
machine immediately on connect instead.

CommandList::processCommand() was a no-op stub - the intended
"typing help lists the registered commands" body was commented out,
and even referenced a Command::getName() that was never added to the
base class. The map's own key from add() already is the registered
name, so this just walks it directly.
2026-09-06 04:05:59 +00:00
Brad Arant a391882541 Made server a pointer for eliminating TCPSession2. 2024-07-30 15:59:25 -07:00
Brad Arant 86bd62221f Merge branch 'develop' of ssh://barant.com/git/ServerCore into develop 2021-08-11 21:59:25 -07:00
Brad Arant b7398afc05 It works!!! 2021-08-11 21:38:22 -07:00
Brad Arant b16e2e1a1b Compiles. 2021-08-10 14:07:50 -07:00
Brad Arant 43489e5b3a Updated code 2021-08-08 10:47:55 -07:00
barant d445834af6 Many changes to ServerCore 2021-07-23 08:57:27 -07:00
barant b4ab5fb86a New build. 2020-04-13 09:40:58 -07:00
barant a5a51f8aae Major changes to socket scheduling in EPoll. 2020-02-29 19:27:58 -08:00
barant a40f7314a8 Elimination of Service object, 2019-09-18 18:32:15 -07:00
barant a46db126e9 Continued restructing. 2019-09-13 09:16:55 -07:00
Brad Arant 2cb1e3e2f2 Implementation of Serice object into structure. 2019-02-16 12:01:36 -08:00
Brad Arant d8b1275884 Initial repository 1.0.0 2019-02-07 13:28:21 -08:00