comparison src/constants.rs @ 92:5ddbcada30f2

Add the ability to log against a PAM handle. PAM impls provide a way to log to syslog. This exposes it via nonstick.
author Paul Fisher <paul@pfish.zone>
date Sun, 22 Jun 2025 19:29:32 -0400
parents f6186e41399b
children efe2f5f8b5b2
comparison
equal deleted inserted replaced
91:039aae9a01f7 92:5ddbcada30f2
20 /// **The values of these constants are deliberately selected _not_ to match 20 /// **The values of these constants are deliberately selected _not_ to match
21 /// any PAM implementations. Applications should always use the symbolic value 21 /// any PAM implementations. Applications should always use the symbolic value
22 /// and not a magic number.** 22 /// and not a magic number.**
23 #[cfg(not(feature = "link"))] 23 #[cfg(not(feature = "link"))]
24 mod pam_ffi { 24 mod pam_ffi {
25 use std::ffi::c_uint;
26
25 macro_rules! define { 27 macro_rules! define {
26 ($(#[$attr:meta])* $($name:ident = $value:expr),+) => { 28 ($(#[$attr:meta])* $($name:ident = $value:expr),+) => {
27 define!( 29 define!(
28 @meta { $(#[$attr])* } 30 @meta { $(#[$attr])* }
29 $(pub const $name: u32 = $value;)+ 31 $(pub const $name: u32 = $value;)+
79 PAM_SYSTEM_ERR = 551, 81 PAM_SYSTEM_ERR = 551,
80 PAM_TRY_AGAIN = 552, 82 PAM_TRY_AGAIN = 552,
81 PAM_USER_UNKNOWN = 553 83 PAM_USER_UNKNOWN = 553
82 ); 84 );
83 85
84 fn strerror(val: c_uint) -> Option<&'static str> { 86 /// Dummy implementation of strerror so that it always returns None.
87 pub fn strerror(val: c_uint) -> Option<&'static str> {
88 _ = val;
85 None 89 None
86 } 90 }
87 } 91 }
88 92
89 bitflags! { 93 bitflags! {