Enum pam_kanidm::module::PamHandle
source · pub enum PamHandle {}
Expand description
Opaque type, used as a pointer when making pam API calls.
A module is invoked via an external function such as pam_sm_authenticate
.
Such a call provides a pam handle pointer. The same pointer should be given
as an argument when making API calls.
Implementations§
source§impl PamHandle
impl PamHandle
sourcepub unsafe fn get_data<'a, T>(&'a self, key: &str) -> PamResult<&'a T>
pub unsafe fn get_data<'a, T>(&'a self, key: &str) -> PamResult<&'a T>
Gets some value, identified by key
, that has been set by the module
previously.
See pam_get_data
in
http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html
sourcepub fn set_data<T>(&self, key: &str, data: Box<T>) -> PamResult<()>
pub fn set_data<T>(&self, key: &str, data: Box<T>) -> PamResult<()>
Stores a value that can be retrieved later with get_data
. The value lives
as long as the current pam cycle.
See pam_set_data
in
http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html
sourcepub fn get_item<'a, T: PamItem>(&self) -> PamResult<&'a T>
pub fn get_item<'a, T: PamItem>(&self) -> PamResult<&'a T>
Retrieves a value that has been set, possibly by the pam client. This is
particularly useful for getting a PamConv
reference.
See pam_get_item
in
http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html
sourcepub fn set_item_str<T: PamItem>(&mut self, item: &str) -> PamResult<()>
pub fn set_item_str<T: PamItem>(&mut self, item: &str) -> PamResult<()>
Sets a value in the pam context. The value can be retrieved using
get_item
.
Note that all items are strings, except PAM_CONV
and PAM_FAIL_DELAY
.
See pam_set_item
in
http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html
sourcepub fn get_user(&self, prompt: Option<&str>) -> PamResult<String>
pub fn get_user(&self, prompt: Option<&str>) -> PamResult<String>
Retrieves the name of the user who is authenticating or logging in.
This is really a specialization of get_item
.
See pam_get_user
in
http://www.linux-pam.org/Linux-PAM-html/mwg-expected-by-module-item.html