AmendHub

jcs

/

subtext

/

amendments

/

138

session: Cleanup after banned username login


jcs made amendment 138 5 months ago
--- session.c Sun Jun 12 12:06:51 2022 +++ session.c Sun Jun 12 15:29:47 2022 @@ -479,7 +479,8 @@ session_input_char(struct session *session) short consumed = 0; wait_for_char: - if (!session_wait_for_chars(session, 0, waiting_for)) { + if (session->ibuflen < waiting_for && + !session_wait_for_chars(session, 0, waiting_for)) { if (Time - session->last_input_at > (db->config.max_idle_minutes * 60)) goto idled_out; @@ -764,7 +765,7 @@ session_login(struct session *s) if (!user && user_username_is_banned(username)) { session_log(s, "Attempted login as banned username %s", username); - return AUTH_USER_FAILED; + goto login_bail; } }