Skip to content

Conversation

@bjorn3
Copy link
Collaborator

@bjorn3 bjorn3 commented Nov 18, 2025

There is no need to do so and this refactor clarifies exactly when HiddenInput::new() returns Some. With this we no longer disable feedback on /dev/tty when we are reading a password from a pipe and we disable feedback on the correct tty if stdin is a different tty than /dev/tty. Once we implement askpass this also prevents interfering with the askpass program if it reads from the tty.

@bjorn3 bjorn3 added this to the askpass milestone Nov 18, 2025
@bjorn3 bjorn3 requested a review from squell November 18, 2025 15:35
@bjorn3 bjorn3 force-pushed the refactor_pam_rpassword branch from d5ec9d6 to c169523 Compare November 18, 2025 15:52
There is no need to do so and this refactor clarifies exactly when
HiddenInput::new() returns Some. With this we no longer disable feedback
on /dev/tty when we are reading a password from a pipe and we disable
feedback on the correct tty if stdin is a different tty than /dev/tty.
Once we implement askpass this also prevents interfering with the
askpass program if it reads from the tty.
@bjorn3 bjorn3 force-pushed the refactor_pam_rpassword branch from c169523 to 19d6db4 Compare November 19, 2025 12:17
This is necessary for askpass as with askpass the prompt is passed to
the askpass program rather than directly printed to stdout.
@squell
Copy link
Member

squell commented Nov 19, 2025

See my suggestions here: bjorn3#6

I think we are on the same page except that the .as_ref() also is not necessary :-)

@bjorn3 bjorn3 force-pushed the refactor_pam_rpassword branch from 7107f02 to 295d4f7 Compare November 19, 2025 13:44
@squell
Copy link
Member

squell commented Nov 19, 2025

Sorry, didn't run cargo check --tests only cargo check. :-)

Copy link
Member

@squell squell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing the tests is trivial, the rest looks good (it's nice that all the critical input path now goes through the same code paths)

@squell squell enabled auto-merge November 19, 2025 14:13
@squell squell merged commit 6d3b14a into trifectatechfoundation:main Nov 19, 2025
17 checks passed
@bjorn3 bjorn3 deleted the refactor_pam_rpassword branch November 19, 2025 14:21
@squell squell added the C-pam PAM library label Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-pam PAM library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants