Struct pamsm::Pam [−][src]
pub struct Pam(_);
Expand description
Opaque PAM handle, with additional native methods available via PamLibExt
.
Trait Implementations
impl PamLibExt for Pam
[src]
impl PamLibExt for Pam
[src]fn get_user(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
[src]
fn get_user(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
[src]Get the username. If the PAM_USER item is not set, this function prompts for a username (like get_authtok). Returns PamError::SERVICE_ERR if the prompt contains any null byte Read more
fn get_cached_user(&self) -> PamResult<Option<&CStr>>
[src]
fn get_cached_user(&self) -> PamResult<Option<&CStr>>
[src]Get the username, i.e. the PAM_USER item. If it’s not set return None.
fn get_cached_authtok(&self) -> PamResult<Option<&CStr>>
[src]
fn get_cached_authtok(&self) -> PamResult<Option<&CStr>>
[src]Get the cached authentication token.
fn get_cached_oldauthtok(&self) -> PamResult<Option<&CStr>>
[src]
fn get_cached_oldauthtok(&self) -> PamResult<Option<&CStr>>
[src]Get the cached old authentication token.
fn get_authtok(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
[src]
fn get_authtok(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
[src]Get the cached authentication token or prompt the user for one if there isn’t any. Returns PamError::SERVICE_ERR if the prompt contains any null byte Read more
fn set_authtok(&self, authtok: &CString) -> PamResult<()>
[src]
fn conv(
&self,
prompt: Option<&str>,
style: PamMsgStyle
) -> PamResult<Option<&CStr>>
[src]
fn conv(
&self,
prompt: Option<&str>,
style: PamMsgStyle
) -> PamResult<Option<&CStr>>
[src]Prompt the user for custom input. Returns PamError::SERVICE_ERR if the prompt contains any null byte Read more
fn getenv(&self, name: &str) -> PamResult<Option<&CStr>>
[src]
fn getenv(&self, name: &str) -> PamResult<Option<&CStr>>
[src]Get a variable from the pam environment list.
fn putenv(&self, name_value: &str) -> PamResult<()>
[src]
fn putenv(&self, name_value: &str) -> PamResult<()>
[src]Put a variable in the pam environment list.
name_value
takes for form documented in pam_putent(3) : Read more
unsafe fn send_data<T: PamData + Clone + Send>(
&self,
module_name: &str,
data: T
) -> PamResult<()>
[src]
unsafe fn send_data<T: PamData + Clone + Send>(
&self,
module_name: &str,
data: T
) -> PamResult<()>
[src]Send data to be stored by the pam library under the name module_name
.
The data can then be retrieved from a different
callback in this module, or even by a different module
using retrieve_data<T>
. Read more
unsafe fn retrieve_data<T: PamData + Clone + Send>(
&self,
module_name: &str
) -> PamResult<T>
[src]
unsafe fn retrieve_data<T: PamData + Clone + Send>(
&self,
module_name: &str
) -> PamResult<T>
[src]Retrieve data previously stored with send_data<T>
. Read more
fn send_bytes(
&self,
module_name: &str,
data: Vec<u8>,
cb: Option<PamCleanupCb>
) -> PamResult<()>
[src]
fn send_bytes(
&self,
module_name: &str,
data: Vec<u8>,
cb: Option<PamCleanupCb>
) -> PamResult<()>
[src]fn retrieve_bytes(&self, module_name: &str) -> PamResult<Vec<u8>>
[src]
fn retrieve_bytes(&self, module_name: &str) -> PamResult<Vec<u8>>
[src]Retrieve bytes previously stored with send_bytes
.
The result is a clone of the data. Read more