Do not prefer a dialog on a machine with nowhere to draw it

config/bash/shell exported SSH_ASKPASS=ksshaskpass with
SSH_ASKPASS_REQUIRE=prefer on every machine. `prefer` means ssh and git reach
for that dialog BEFORE the terminal prompt, so on a headless server the
prompt that would have worked was skipped in favour of a KDE window that
cannot open:

  error: /usr/bin/ksshaskpass died of signal 6
  fatal: could not read Username for 'https://git.gbrown.org'

A push from a server failed to ASK for a username rather than failing to
authenticate. The shell environment is the one half of Panama a server does
install, so nothing downstream was going to catch this.

The export is now conditional on a session existing to draw in, and on the
binary being there to run. The headless branch also CLEARS both variables
rather than merely declining to set them: an askpass inherited from a parent
that had a display, or from a login predating this guard, is exactly as
unusable and a guard that only withholds leaves it in place. A fresh login
shell on the repaired server still reported prefer until it cleared them.

A desktop is unchanged; a server, a serial console and a plain SSH session
fall back to the terminal prompt, which works.

tests/setup/headless-askpass-contract pins every branch, the inherited case
included, and fails against the previous code and against a guard that only
withholds.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
gibandClaude Opus 5 committed 2026-10-01 17:50:14 -04:00
1 parent a493fa5584
commit a664cf68f5
4 files changed
+102 -3

No files matched your search

+1
View File
@@ -261,6 +261,7 @@ hermetic tests/setup/firefox-chrome-contract
hermetic tests/setup/hardware-contract
# Reads the host hardware predicates after exercising fixture sysfs trees.
live-host tests/setup/hardware-predicates-contract
hermetic tests/setup/headless-askpass-contract
hermetic tests/setup/hooks-contract
hermetic tests/setup/interview-contract
hermetic tests/setup/launch-or-focus-contract