Mercurial > crates > nonstick
comparison src/lib.rs @ 64:bbe84835d6db v0.0.5
More organization; add lots of docs.
- moves `PamHandle` to its own module, since it will be used
by both modules and clients.
- adds a ton of documentation to the `PamModule` trait
and reorders methods to most-interesting-first.
- adds more flag values from pam_modules.h.
- other misc cleanup.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Thu, 22 May 2025 01:52:32 -0400 |
parents | a7aa5ca0d00d |
children |
comparison
equal
deleted
inserted
replaced
63:a7aa5ca0d00d | 64:bbe84835d6db |
---|---|
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 new password-based authenticator), | 11 //! In the simplest case (for a new password-based authenticator), |
12 //! this will be the [`sm_authenticate`](PamModule::sm_authenticate) function. | 12 //! this will be the [`PamModule::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 //! <code>/usr/lib/security/pam_<var>your_module</var>.so</code>, | 16 //! <code>/usr/lib/security/pam_<var>your_module</var>.so</code>, |
17 //! or maybe | 17 //! or maybe |
24 | 24 |
25 pub mod constants; | 25 pub mod constants; |
26 #[cfg(feature = "experimental")] | 26 #[cfg(feature = "experimental")] |
27 pub mod conv; | 27 pub mod conv; |
28 pub mod items; | 28 pub mod items; |
29 pub mod module; | 29 mod module; |
30 | 30 |
31 mod handle; | |
31 mod memory; | 32 mod memory; |
32 mod pam_ffi; | 33 mod pam_ffi; |
33 | 34 |
34 #[doc(inline)] | 35 #[doc(inline)] |
35 pub use crate::{ | 36 pub use crate::{ |
36 constants::{ErrorCode, Flags, Result}, | 37 constants::{ErrorCode, Flags, Result}, |
37 module::{PamHandle, PamModule}, | 38 handle::PamHandle, |
39 module::PamModule, | |
38 }; | 40 }; |