Mercurial > crates > nonstick
diff src/libpam/handle.rs @ 134:6c1e1bdb4164
Use standard #[cfg] directives rather than custom proc macros.
Instead of having to do a bunch of custom parsing and other logic
that tools often choke on, this change introduces an easy way
to depend upon custom #[cfg]s provided by the libpam-sys crate.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Thu, 03 Jul 2025 11:03:36 -0400 |
parents | a632a8874131 |
children |
line wrap: on
line diff
--- a/src/libpam/handle.rs Wed Jul 02 03:33:09 2025 -0400 +++ b/src/libpam/handle.rs Thu Jul 03 11:03:36 2025 -0400 @@ -14,7 +14,6 @@ use std::cell::Cell; use std::ffi::{c_char, c_int, CString}; -use libpam_sys::cfg_pam_impl; use std::ptr; use std::ptr::NonNull; @@ -279,7 +278,7 @@ } impl PamHandleModule for LibPamHandle { - #[cfg_pam_impl(any("LinuxPam", "OpenPam"))] + #[cfg(any(pam_impl = "LinuxPam", pam_impl = "OpenPam"))] fn authtok(&mut self, prompt: Option<&str>) -> Result<String> { let prompt = memory::option_cstr(prompt)?; let mut output: *const c_char = ptr::null_mut(); @@ -299,7 +298,7 @@ .unwrap_or(Err(ErrorCode::ConversationError)) } - #[cfg_pam_impl(not(any("LinuxPam", "OpenPam")))] + #[cfg(not(any(pam_impl = "LinuxPam", pam_impl = "OpenPam")))] fn authtok(&mut self, prompt: Option<&str>) -> Result<String> { Err(ErrorCode::ConversationError) }