comparison src/libpam/module.rs @ 174:9e4ce1631bd3

Dramatically expand documentation.
author Paul Fisher <paul@pfish.zone>
date Tue, 29 Jul 2025 18:58:27 -0400
parents 46e8ce5cd5d1
children
comparison
equal deleted inserted replaced
173:46e8ce5cd5d1 174:9e4ce1631bd3
15 /// Here is full example of a PAM module that would authenticate 15 /// Here is full example of a PAM module that would authenticate
16 /// and authorize everybody: 16 /// and authorize everybody:
17 /// 17 ///
18 /// ```no_run 18 /// ```no_run
19 /// use nonstick::{ 19 /// use nonstick::{
20 /// pam_export, ConversationAdapter, AuthnFlags, LibPamTransaction, ModuleClient, PamModule, 20 /// pam_export, AuthnFlags, ConversationAdapter, LibPamTransaction, ModuleClient, PamModule,
21 /// Result as PamResult, 21 /// Result as PamResult,
22 /// }; 22 /// };
23 /// use std::ffi::CStr; 23 /// use std::ffi::CStr;
24 /// # fn main() {} 24 /// # fn main() {}
25 /// 25 ///
33 /// format!("If you say your password is {password:?}, who am I to disagree?"); 33 /// format!("If you say your password is {password:?}, who am I to disagree?");
34 /// handle.info_msg(&response); 34 /// handle.info_msg(&response);
35 /// Ok(()) 35 /// Ok(())
36 /// } 36 /// }
37 /// 37 ///
38 /// fn account_management(handle: &mut T, args: Vec<&CStr>, flags: AuthnFlags) -> PamResult<()> { 38 /// fn account_management(
39 /// handle: &mut T,
40 /// args: Vec<&CStr>,
41 /// flags: AuthnFlags,
42 /// ) -> PamResult<()> {
39 /// let username = handle.username(None)?; 43 /// let username = handle.username(None)?;
40 /// let response = format!("Hello {username:?}! I trust you unconditionally."); 44 /// let response = format!("Hello {username:?}! I trust you unconditionally.");
41 /// handle.info_msg(&response); 45 /// handle.info_msg(&response);
42 /// Ok(()) 46 /// Ok(())
43 /// } 47 /// }