|
consistency (#372)
ftp server: call logout callback on client timeout for consistency
Otherwise this is not symmetric with the other case where logout is also
called when the client disconnects.
Refactor performing the logout into a separate helper to avoid
duplication.
Fix security bug: stale authenticated flag after inactivity timeout.
Moving nx_ftp_client_request_authenticated = NX_FALSE into the
_nx_ftp_server_logout_client helper ensures every call site (QUIT,
disconnect, and now timeout) consistently resets auth state. Before
this fix, a new TCP connection accepted on a timed-out socket slot
could issue commands without USER/PASS.
Remove the now-redundant per-callsite authenticated resets in the QUIT
handler and the control-disconnect processing path.
Fix AUTHOR field in _nx_ftp_server_logout_client (was 'TBD').
Remove trailing whitespace from the new function comment block and from
the blank line following the QUIT logout call.
Add regression test netx_ftp_server_activity_timeout_test that forces
the inactivity timer to fire, asserts the logout callback is invoked,
uses a raw TCP connection to verify commands are rejected with 530
before USER/PASS (demonstrating the auth-reset fix), and confirms a
fresh authenticated session works normally.
Co-authored-by: Frédéric Desbiens <[email protected]>
Co-authored-by: Copilot <[email protected]>
|