Mercurial > crates > nonstick
comparison src/libpam/handle.rs @ 174:9e4ce1631bd3
Dramatically expand documentation.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 29 Jul 2025 18:58:27 -0400 |
parents | e27c5c667a5a |
children | e30775c80b49 |
comparison
equal
deleted
inserted
replaced
173:46e8ce5cd5d1 | 174:9e4ce1631bd3 |
---|---|
42 .field("conversation", &format!("{:p}", self.conversation)) | 42 .field("conversation", &format!("{:p}", self.conversation)) |
43 .finish() | 43 .finish() |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 /// Builder to start a [`LibPamTransaction`]. | |
48 /// | |
49 /// Use [`Self::new_with_service`] to build a new PAM transaction. | |
47 #[derive(Debug, PartialEq)] | 50 #[derive(Debug, PartialEq)] |
48 pub struct TransactionBuilder { | 51 pub struct TransactionBuilder { |
49 service_name: OsString, | 52 service_name: OsString, |
50 username: Option<OsString>, | 53 username: Option<OsString>, |
51 } | 54 } |
54 /// Creates a builder to start a PAM transaction for the given service. | 57 /// Creates a builder to start a PAM transaction for the given service. |
55 /// | 58 /// |
56 /// The service name is what controls the steps and checks PAM goes through | 59 /// The service name is what controls the steps and checks PAM goes through |
57 /// when authenticating a user. This corresponds to the configuration file | 60 /// when authenticating a user. This corresponds to the configuration file |
58 /// usually at <code>/etc/pam.d/<var>service_name</var></code>. | 61 /// usually at <code>/etc/pam.d/<var>service_name</var></code>. |
62 /// | |
63 /// You usually want to call [`username`](Self::username) to set | |
64 /// the username before starting the transaction. | |
59 /// | 65 /// |
60 /// # References | 66 /// # References |
61 #[doc = linklist!(pam_start: adg, _std)] | 67 #[doc = linklist!(pam_start: adg, _std)] |
62 /// | 68 /// |
63 #[doc = stdlinks!(3 pam_start)] | 69 #[doc = stdlinks!(3 pam_start)] |
130 /// to [`pam_end` on Linux-PAM][man7], which signals that data cleanup | 136 /// to [`pam_end` on Linux-PAM][man7], which signals that data cleanup |
131 /// should "not treat the call too seriously" \[sic]. | 137 /// should "not treat the call too seriously" \[sic]. |
132 /// | 138 /// |
133 /// On other platforms, this is no different than letting the transaction | 139 /// On other platforms, this is no different than letting the transaction |
134 /// end on its own. | 140 /// end on its own. |
135 /// | |
136 #[doc = man7!(3 pam_end)] | 141 #[doc = man7!(3 pam_end)] |
137 pub fn end_silent(self) { | 142 pub fn end_silent(self) { |
138 #[cfg(pam_impl = "LinuxPam")] | 143 #[cfg(pam_impl = "LinuxPam")] |
139 { | 144 { |
140 let mut me = std::mem::ManuallyDrop::new(self); | 145 let mut me = std::mem::ManuallyDrop::new(self); |