1a15f6ced84a15a4e8bd4d45e6a790d0bfa65c77
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.
Description
This repository provides core functionality for TCP and UDP servers using the epoll linux function.
184 MiB
0 Stars
1 Watchers
0 Forks
Languages
C++
99.6%
Shell
0.4%