auth dialog: keep typed text when the polkit helper ends before asking
CI / test (push) Successful in 2m1s

If polkit-agent-helper-1 exited (or the socket service refused) before
sending a PAM prompt, the dialog counted it as a wrong password, wiped the
field and restarted the helper immediately, in a tight loop, so typing
seemed to do nothing. Now such an early end keeps what was typed, shows
why, and retries after 1s/2s/4s (then on Enter). Every helper event and
route is logged as "chandra: polkit helper ..." (never the typed text).

Adds an end-to-end test that types through handle_input with a real
xkbcommon keymap, including Shift, across a helper that dies at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgkRPrAzXECBUGmNEE
This commit is contained in:
Claude committed 2026-11-26 01:31:59 +00:00
1 parent ac2d0fa205
commit fa634956cc
4 files changed
+237 -4

No files matched your search

+13 -2
View File
@@ -101,6 +101,14 @@ pub(all) enum HelperRoute {
Program(String)
} derive(Eq, Debug)
///| A route, for the log.
fn route_text(r : HelperRoute) -> String {
match r {
Socket(p) => "socket " + p
Program(p) => p
}
}
///| One run of the helper: the connection and the bytes read but not yet a whole line.
pub struct HelperSession {
mut fd : Int
@@ -114,8 +122,11 @@ pub struct HelperSession {
pub fn HelperSession::start_any(routes : Array[HelperRoute], user : String, cookie : String) -> HelperSession? {
for r in routes {
match HelperSession::start(r, user, cookie) {
Some(s) => return Some(s)
None => ()
Some(s) => {
@sys.log("chandra: polkit helper for " + user + " via " + route_text(r))
return Some(s)
}
None => @sys.log("chandra: polkit helper not reachable via " + route_text(r))
}
}
None