diff src/module.rs @ 146:1bc52025156b

Split PAM items into their own separate struct. To trim down the number of methods on `PamShared`, this puts all the Items into their own struct(s). This also makes the split between authtok/authtok_item easier to understand.
author Paul Fisher <paul@pfish.zone>
date Sun, 06 Jul 2025 19:10:26 -0400
parents f6186e41399b
children
line wrap: on
line diff
--- a/src/module.rs	Sun Jul 06 19:04:57 2025 -0400
+++ b/src/module.rs	Sun Jul 06 19:10:26 2025 -0400
@@ -4,7 +4,7 @@
 #![allow(dead_code)]
 
 use crate::constants::{ErrorCode, Flags, Result};
-use crate::handle::PamHandleModule;
+use crate::handle::ModuleClient;
 use std::ffi::CStr;
 
 /// A trait for a PAM module to implement.
@@ -21,7 +21,7 @@
 /// [manpage]: https://www.man7.org/linux/man-pages/man3/pam.3.html
 /// [mwg]: https://www.chiark.greenend.org.uk/doc/libpam-doc/html/Linux-PAM_MWG.html
 #[allow(unused_variables)]
-pub trait PamModule<T: PamHandleModule> {
+pub trait PamModule<T: ModuleClient> {
     // Functions for auth modules.
 
     /// Authenticate the user.
@@ -29,7 +29,7 @@
     /// This is probably the first thing you want to implement.
     /// In most cases, you will want to get the user and password,
     /// using [`PamShared::username`](crate::PamShared::username)
-    /// and [`PamHandleModule::authtok`],
+    /// and [`ModuleClient::authtok`],
     /// and verify them against something.
     ///
     /// See [the Module Writer's Guide entry for `pam_sm_authenticate`][mwg]