What's wrong
Follow-up to #33. That issue's slice 2 made the two state-mismatch refusals render both
account names through printf '%q', so invisible whitespace becomes visible. The message
still wraps each name in its own literal single quotes, which is deliberate: an ordinary
whitespace-free name passes %q unchanged, so the common refusal reads exactly as it did
before.
An empty recorded name does not. printf '%q' '' produces '', and nested inside the
message's own quotes that renders as four consecutive apostrophes:
refusing to remove dchost: install state records host account ''''
Baseline (before #33) printed ''.
How it is reached
read_install_state resets HOST_ACCOUNT to empty when install.state is absent
(install-lib.sh:220). An uninstall on a box that has a matching passwd/GECOS entry but
no state file therefore reaches host_account_removable's rail 5 (install-lib.sh:305-306)
with an empty recorded name.
Severity
Cosmetic/low. The refusal is correct and the operator is still stopped for the right reason;
the message just reads as a typo rather than as "nothing is recorded".
Fix direction
Either drop the message's own literal quotes at that site and let %q supply the only
quoting, or special-case the empty recorded name with an explicit marker
(e.g. (no account recorded)).
Proof asked for
A test driving host_account_removable with no install.state present, asserting the
refusal reads as one empty-string marker rather than four consecutive apostrophes.
Provenance
Found by the seraph during issue #33's run (finding-a2f036af25f7, invocation
inv-006-7ba40bbc), verified with cat -A. Filed rather than fixed in that run: the finding
asks for a new test, and whoever writes a test must not be whoever satisfies it.
What's wrong
Follow-up to #33. That issue's slice 2 made the two state-mismatch refusals render both
account names through
printf '%q', so invisible whitespace becomes visible. The messagestill wraps each name in its own literal single quotes, which is deliberate: an ordinary
whitespace-free name passes
%qunchanged, so the common refusal reads exactly as it didbefore.
An empty recorded name does not.
printf '%q' ''produces'', and nested inside themessage's own quotes that renders as four consecutive apostrophes:
Baseline (before #33) printed
''.How it is reached
read_install_stateresetsHOST_ACCOUNTto empty wheninstall.stateis absent(
install-lib.sh:220). An uninstall on a box that has a matchingpasswd/GECOS entry butno state file therefore reaches
host_account_removable's rail 5 (install-lib.sh:305-306)with an empty recorded name.
Severity
Cosmetic/low. The refusal is correct and the operator is still stopped for the right reason;
the message just reads as a typo rather than as "nothing is recorded".
Fix direction
Either drop the message's own literal quotes at that site and let
%qsupply the onlyquoting, or special-case the empty recorded name with an explicit marker
(e.g.
(no account recorded)).Proof asked for
A test driving
host_account_removablewith noinstall.statepresent, asserting therefusal reads as one empty-string marker rather than four consecutive apostrophes.
Provenance
Found by the seraph during issue #33's run (
finding-a2f036af25f7, invocationinv-006-7ba40bbc), verified withcat -A. Filed rather than fixed in that run: the findingasks for a new test, and whoever writes a test must not be whoever satisfies it.