Mercurial > crates > nonstick
comparison src/lib.rs @ 62:d83623951070
Further improve docs and put `conv` behind a feature gate.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Wed, 21 May 2025 23:10:09 -0400 |
parents | 05cc2c27334f |
children | a7aa5ca0d00d |
comparison
equal
deleted
inserted
replaced
61:5eecd797fc69 | 62:d83623951070 |
---|---|
1 //! A safe, nonstick interface to PAM. | 1 //! A safe, nonstick interface to PAM. |
2 //! | 2 //! |
3 //! This implements a type-safe library to interact with PAM. | 3 //! This implements a type-safe library to interact with PAM. |
4 //! Currently, it implements the subset of PAM useful for implementing a module. | 4 //! Currently, it implements a subset of PAM useful for implementing a module. |
5 //! | 5 //! |
6 //! To write a new PAM module using this crate: | 6 //! To write a new PAM module using this crate: |
7 //! | 7 //! |
8 //! 1. Create a `dylib` crate. | 8 //! 1. Create a `dylib` crate. |
9 //! 2. Implement a subset of the functions in the [PamModule] trait | 9 //! 2. Implement a subset of the functions in the [`PamModule`] trait |
10 //! corresponding to what you want your module to do. | 10 //! corresponding to what you want your module to do. |
11 //! In the simplest case (for a password-authentication system), | 11 //! In the simplest case (for a new password-based authenticator), |
12 //! this will be the [PamModule::sm_authenticate] function. | 12 //! this will be the [`sm_authenticate`](PamModule::sm_authenticate) function. |
13 //! 3. Export your PAM module using the [pam_hooks!] macro. | 13 //! 3. Export your PAM module using the [`pam_hooks!`] macro. |
14 //! 4. Build and install the dynamic library. | 14 //! 4. Build and install the dynamic library. |
15 //! This usually entails placing it at | 15 //! This usually entails placing it at |
16 //! `/usr/lib/security/pam_your_module.so`, | 16 //! <code>/usr/lib/security/pam_<var>your_module</var>.so</code>, |
17 //! or maybe | 17 //! or maybe |
18 //! <code>/usr/lib/<var>your-architecture</var>/security/pam_your_module.so</code>. | 18 //! <code>/usr/lib/<var>your-architecture</var>/security/pam_<var>your_module</var>.so</code>. |
19 //! | 19 //! |
20 //! For general information on writing PAM modules, see | 20 //! For general information on writing PAM modules, see |
21 //! [The Linux-PAM Module Writers' Guide][module-guide] | 21 //! [The Linux-PAM Module Writers' Guide][module-guide] |
22 //! | 22 //! |
23 //! [module-guide]: https://www.chiark.greenend.org.uk/doc/libpam-doc/html/Linux-PAM_MWG.html | 23 //! [module-guide]: https://www.chiark.greenend.org.uk/doc/libpam-doc/html/Linux-PAM_MWG.html |
24 | 24 |
25 pub mod constants; | 25 pub mod constants; |
26 #[cfg(feature = "experimental")] | |
26 pub mod conv; | 27 pub mod conv; |
27 pub mod items; | 28 pub mod items; |
28 pub mod module; | 29 pub mod module; |
29 | 30 |
30 mod memory; | 31 mod memory; |
31 mod pam_ffi; | 32 mod pam_ffi; |
32 | 33 |
33 #[doc(inline)] | 34 #[doc(inline)] |
34 pub use crate::{ | 35 pub use crate::{ |
35 constants::{ErrorCode, Flags, MessageStyle, Result}, | 36 constants::{ErrorCode, Flags, MessageStyle, Result}, |
36 conv::Conversation, | |
37 module::{PamHandle, PamModule}, | 37 module::{PamHandle, PamModule}, |
38 }; | 38 }; |