From a9a74679fbec07cf158f2295513e3d4c4adc2666 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 11 Mar 2026 14:15:45 +0100 Subject: Port pam-any from pam-bindings to nonstick crate The pam-bindings crate has a critical bug where pam_try! returns PAM_SUCCESS on error in release builds (anowell/pam-rs#16), causing authentication to always succeed. This replaces it with nonstick and a custom pam_client module with raw PAM FFI for thread-safe conversation forwarding. --- src-repo/src/un_hide_input.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src-repo/src/un_hide_input.rs (limited to 'src-repo/src/un_hide_input.rs') diff --git a/src-repo/src/un_hide_input.rs b/src-repo/src/un_hide_input.rs new file mode 100644 index 0000000..6350739 --- /dev/null +++ b/src-repo/src/un_hide_input.rs @@ -0,0 +1,9 @@ +use std::io; +use termios::{ECHO, ICANON, TCSANOW, tcsetattr, Termios}; + +pub fn un_hide_input() -> io::Result<()> { + let mut termios = Termios::from_fd(libc::STDIN_FILENO)?; + termios.c_lflag |= ECHO | ICANON; + tcsetattr(libc::STDIN_FILENO, TCSANOW, &termios)?; + Ok(()) +} \ No newline at end of file -- cgit v1.3.1