Skip to content

Conversation

@MggMuggins
Copy link
Contributor

Fixes #1171

Happy to put together an automated test for this but I thought I'd start with an implementation.

Comment on lines 287 to 288
let rslt = if let Some(hide_input) = HiddenInput::new(true)? {
match self {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can stay a single match, right? So let ret = match (HiddenInput::new(true)?, self) { ... };

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so... as I noted in the commit message (expanded upon in the second submission), creating the tuple could cause a move of self, which we need to use later. Here's a silly example.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't &mut *self work in that case?

@bjorn3
Copy link
Collaborator

bjorn3 commented Oct 13, 2025

Thanks for the PR!

Creating the tuple `(HiddenInput::new(true)?, self)` moves `self`, which
we still need to use later (to write a newline if the read fails).

Signed-off-by: Wesley Hershberger <[email protected]>
@MggMuggins
Copy link
Contributor Author

Here's the rebase delta: MggMuggins/sudo-rs@fix-timeout-fmt-v1...fix-timeout-fmt-v2

@squell squell added C-pam PAM library freeze Temporarily blocked from merging pending a release labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-pam PAM library freeze Temporarily blocked from merging pending a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aesthetics in passwd_timeout + PAM modules that talk to the user.

3 participants