Mercurial > crates > nonstick
comparison src/libpam/question.rs @ 179:dba9c1f40883
Get rid of unnecessary `style_const` module in question.rs.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Wed, 30 Jul 2025 18:07:51 -0400 |
parents | 4d11b2e7da83 |
children | a1bb1d013567 |
comparison
equal
deleted
inserted
replaced
178:6c75fb621b55 | 179:dba9c1f40883 |
---|---|
9 use num_enum::{IntoPrimitive, TryFromPrimitive}; | 9 use num_enum::{IntoPrimitive, TryFromPrimitive}; |
10 use std::ffi::{c_int, c_void, CStr, OsStr}; | 10 use std::ffi::{c_int, c_void, CStr, OsStr}; |
11 use std::os::unix::ffi::OsStrExt; | 11 use std::os::unix::ffi::OsStrExt; |
12 use std::ptr::NonNull; | 12 use std::ptr::NonNull; |
13 | 13 |
14 mod style_const { | |
15 pub use libpam_sys::*; | |
16 #[cfg(not(feature = "link"))] | |
17 #[cfg_pam_impl(not("LinuxPam"))] | |
18 pub const PAM_RADIO_TYPE: i32 = 897; | |
19 #[cfg(not(feature = "link"))] | |
20 #[cfg_pam_impl(not("LinuxPam"))] | |
21 pub const PAM_BINARY_PROMPT: i32 = 10010101; | |
22 } | |
23 | |
24 /// The C enum values for messages shown to the user. | 14 /// The C enum values for messages shown to the user. |
25 #[derive(Debug, PartialEq, TryFromPrimitive, IntoPrimitive)] | 15 #[derive(Debug, PartialEq, TryFromPrimitive, IntoPrimitive)] |
26 #[repr(i32)] | 16 #[repr(i32)] |
27 enum Style { | 17 enum Style { |
28 /// Requests information from the user; will be masked when typing. | 18 /// Requests information from the user; will be masked when typing. |
29 PromptEchoOff = style_const::PAM_PROMPT_ECHO_OFF, | 19 PromptEchoOff = libpam_sys::PAM_PROMPT_ECHO_OFF, |
30 /// Requests information from the user; will not be masked. | 20 /// Requests information from the user; will not be masked. |
31 PromptEchoOn = style_const::PAM_PROMPT_ECHO_ON, | 21 PromptEchoOn = libpam_sys::PAM_PROMPT_ECHO_ON, |
32 /// An error message. | 22 /// An error message. |
33 ErrorMsg = style_const::PAM_ERROR_MSG, | 23 ErrorMsg = libpam_sys::PAM_ERROR_MSG, |
34 /// An informational message. | 24 /// An informational message. |
35 TextInfo = style_const::PAM_TEXT_INFO, | 25 TextInfo = libpam_sys::PAM_TEXT_INFO, |
36 /// Yes/No/Maybe conditionals. A Linux-PAM extension. | 26 /// Yes/No/Maybe conditionals. A Linux-PAM extension. |
37 #[cfg(feature = "linux-pam-ext")] | 27 #[cfg(feature = "linux-pam-ext")] |
38 RadioType = style_const::PAM_RADIO_TYPE, | 28 RadioType = libpam_sys::PAM_RADIO_TYPE, |
39 /// For server–client non-human interaction. | 29 /// For server–client non-human interaction. |
40 /// | 30 /// |
41 /// NOT part of the X/Open PAM specification. | 31 /// NOT part of the X/Open PAM specification. |
42 /// A Linux-PAM extension. | 32 /// A Linux-PAM extension. |
43 #[cfg(feature = "linux-pam-ext")] | 33 #[cfg(feature = "linux-pam-ext")] |
44 BinaryPrompt = style_const::PAM_BINARY_PROMPT, | 34 BinaryPrompt = libpam_sys::PAM_BINARY_PROMPT, |
45 } | 35 } |
46 | 36 |
47 /// A question sent by PAM or a module to an application. | 37 /// A question sent by PAM or a module to an application. |
48 /// | 38 /// |
49 /// PAM refers to this as a "message", but we call it a question | 39 /// PAM refers to this as a "message", but we call it a question |