Mercurial > crates > nonstick
annotate src/items.rs @ 149:14708d9061dc
Add safety section to BinaryPayload::total_bytes.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Mon, 07 Jul 2025 12:30:25 -0400 |
parents | 1bc52025156b |
children |
rev | line source |
---|---|
146
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
1 use crate::_doc::{guide, linklist, stdlinks}; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
2 use crate::constants::Result; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
3 #[cfg(doc)] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
4 use crate::handle::{ModuleClient, PamShared}; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
5 use std::ffi::{OsStr, OsString}; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
6 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
7 macro_rules! getter { |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
8 ($(#[$md:meta])* $getter:ident($item:literal $(, see = $see:path)?)) => { |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
9 $(#[$md])* |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
10 #[doc = ""] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
11 #[doc = concat!("Gets the `", $item, "` of the PAM handle.")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
12 $( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
13 #[doc = concat!("See [`", stringify!($see), "`].")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
14 )? |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
15 fn $getter(&self) -> Result<Option<OsString>>; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
16 }; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
17 } |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
18 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
19 pub(crate) use getter; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
20 macro_rules! setter { |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
21 ($(#[$md:meta])* $setter:ident($item:literal $(, see = $see:path)?)) => { |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
22 $(#[$md])* |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
23 #[doc = ""] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
24 #[doc = concat!("Sets the `", $item, "` from the PAM handle.")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
25 $( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
26 #[doc = concat!("See [`", stringify!($see), "`].")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
27 )? |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
28 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
29 /// Sets the item's value. PAM copies the string's contents. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
30 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
31 /// # Panics |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
32 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
33 /// If the string contains a nul byte, this will panic. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
34 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
35 fn $setter(&mut self, value: Option<&OsStr>) -> Result<()>; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
36 }; |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
37 } |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
38 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
39 /// Provides access to Items, pieces of data shared by the PAM application, |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
40 /// modules, and the framework itself. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
41 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
42 /// # References |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
43 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
44 #[doc = linklist!(pam_get_item: mwg, adg, _std)] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
45 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
46 #[doc = guide!(adg: "adg-interface-by-app-expected.html#adg-pam_get_item")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
47 #[doc = guide!(mwg: "mwg-expected-by-module-item.html#mwg-pam_get_item")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
48 #[doc = stdlinks!(3 pam_get_item)] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
49 pub trait Items<'a> { |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
50 getter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
51 /// The identity of the user for whom service is being requested. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
52 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
53 /// Unlike [`username`](PamShared::username), this will simply get |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
54 /// the current state of the user item, and not request the username. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
55 /// While PAM usually sets this automatically in the `username` call, |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
56 /// it may be changed by a module during the PAM transaction. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
57 /// Applications should check it after each step of the PAM process. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
58 user("PAM_USER", see = PamShared::username) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
59 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
60 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
61 getter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
62 /// If set, the identity of the remote user logging in. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
63 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
64 /// This is only as trustworthy as the application calling PAM. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
65 remote_user("PAM_RUSER", see = Self::remote_host) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
66 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
67 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
68 getter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
69 /// If set, the remote location where the user is coming from. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
70 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
71 /// This is only as trustworthy as the application calling PAM. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
72 /// This can be combined with [`Self::remote_user`] to identify |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
73 /// the account the user is attempting to log in from, |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
74 /// with `remote_user@remote_host`. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
75 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
76 /// If unset, "it is unclear where the authentication request |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
77 /// is originating from." |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
78 remote_host("PAM_RHOST", see = Self::remote_user) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
79 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
80 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
81 getter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
82 /// The service name, which identifies the PAM stack which is used |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
83 /// to perform authentication. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
84 service("PAM_SERVICE") |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
85 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
86 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
87 getter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
88 /// The string used to prompt for a user's name. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
89 /// By default, this is a localized version of `login: `. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
90 user_prompt("PAM_USER_PROMPT") |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
91 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
92 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
93 getter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
94 /// The device path of the TTY being used to log in. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
95 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
96 /// This is the terminal the user is logging in on, |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
97 /// specified as the full device path (e.g. `/dev/tty0`). |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
98 /// Very old applications may use this instead of `PAM_XDISPLAY`. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
99 tty_name("PAM_TTY") |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
100 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
101 } |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
102 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
103 /// Provides write access to PAM Items, data shared by the PAM application, |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
104 /// the framework, and modules. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
105 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
106 /// # References |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
107 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
108 #[doc = linklist!(pam_set_item: mwg, adg, _std)] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
109 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
110 #[doc = guide!(adg: "adg-interface-by-app-expected.html#adg-pam_set_item")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
111 #[doc = guide!(mwg: "mwg-expected-by-module-item.html#mwg-pam_set_item")] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
112 #[doc = stdlinks!(3 pam_set_item)] |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
113 pub trait ItemsMut<'a>: Items<'a> { |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
114 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
115 /// Sets the identity of the logging-in user. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
116 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
117 /// Usually this will be set during the course of |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
118 /// a [`username`](PamShared::username) call, but you may set it manually |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
119 /// or change it during the PAM process. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
120 set_user("PAM_USER", see = Items::user) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
121 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
122 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
123 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
124 /// Sets the service name. It's probably a bad idea to change this. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
125 set_service("PAM_SERVICE", see = Items::service) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
126 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
127 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
128 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
129 /// Sets the string used to prompt for a user's name. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
130 set_user_prompt("PAM_USER_PROMPT", see = Items::user_prompt) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
131 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
132 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
133 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
134 /// Sets the path to the terminal where the user is logging on. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
135 set_tty_name("PAM_TTY", see = Items::tty_name) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
136 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
137 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
138 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
139 /// Sets the identity of the remote user logging in. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
140 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
141 /// This may be set by the application before making calls |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
142 /// into a PAM transaction. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
143 set_remote_user("PAM_RUSER", see = Items::remote_user) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
144 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
145 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
146 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
147 /// Sets the location where the user is coming from. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
148 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
149 /// This may be set by the application before making calls |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
150 /// into a PAM transaction. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
151 set_remote_host("PAM_RHOST", see = Items::remote_host) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
152 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
153 |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
154 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
155 /// Gets the user's authentication token (e.g., password). |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
156 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
157 /// This is usually set automatically when |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
158 /// [`authtok`](ModuleClient::authtok) is called, |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
159 /// but can be manually set. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
160 set_authtok("PAM_AUTHTOK", see = ModuleClient::authtok_item) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
161 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
162 setter!( |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
163 /// Sets the user's "old authentication token" when changing passwords. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
164 /// |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
165 /// This is usually set automatically by PAM when |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
166 /// [`old_authtok`](ModuleClient::old_authtok) is called. |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
167 set_old_authtok("PAM_OLDAUTHTOK", see = ModuleClient::old_authtok_item) |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
168 ); |
1bc52025156b
Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
169 } |