#[repr(transparent)]pub struct Pam(_);
Expand description
Opaque PAM handle, with additional native methods available via PamLibExt
.
Trait Implementations
sourceimpl PamLibExt for Pam
impl PamLibExt for Pam
sourcefn get_user(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
fn get_user(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
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
sourcefn get_cached_user(&self) -> PamResult<Option<&CStr>>
fn get_cached_user(&self) -> PamResult<Option<&CStr>>
Get the username, i.e. the PAM_USER item. If it’s not set return None.
sourcefn get_cached_authtok(&self) -> PamResult<Option<&CStr>>
fn get_cached_authtok(&self) -> PamResult<Option<&CStr>>
Get the cached authentication token.
sourcefn get_cached_oldauthtok(&self) -> PamResult<Option<&CStr>>
fn get_cached_oldauthtok(&self) -> PamResult<Option<&CStr>>
Get the cached old authentication token.
sourcefn get_authtok(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
fn get_authtok(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
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<()>
sourcefn get_service(&self) -> PamResult<Option<&CStr>>
fn get_service(&self) -> PamResult<Option<&CStr>>
Get the service name.
sourcefn conv(
&self,
prompt: Option<&str>,
style: PamMsgStyle
) -> PamResult<Option<&CStr>>
fn conv(
&self,
prompt: Option<&str>,
style: PamMsgStyle
) -> PamResult<Option<&CStr>>
Prompt the user for custom input. Returns PamError::SERVICE_ERR if the prompt contains any null byte Read more
sourcefn getenv(&self, name: &str) -> PamResult<Option<&CStr>>
fn getenv(&self, name: &str) -> PamResult<Option<&CStr>>
Get a variable from the pam environment list.
sourcefn putenv(&self, name_value: &str) -> PamResult<()>
fn putenv(&self, name_value: &str) -> PamResult<()>
Put a variable in the pam environment list.
name_value
takes for form documented in pam_putent(3) : Read more
sourceunsafe fn send_data<T: PamData + Clone + Send>(
&self,
module_name: &str,
data: T
) -> PamResult<()>
unsafe fn send_data<T: PamData + Clone + Send>(
&self,
module_name: &str,
data: T
) -> PamResult<()>
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
sourceunsafe fn retrieve_data<T: PamData + Clone + Send>(
&self,
module_name: &str
) -> PamResult<T>
unsafe fn retrieve_data<T: PamData + Clone + Send>(
&self,
module_name: &str
) -> PamResult<T>
Retrieve data previously stored with send_data<T>
. Read more
sourcefn send_bytes(
&self,
module_name: &str,
data: Vec<u8>,
cb: Option<PamCleanupCb>
) -> PamResult<()>
fn send_bytes(
&self,
module_name: &str,
data: Vec<u8>,
cb: Option<PamCleanupCb>
) -> PamResult<()>
sourcefn retrieve_bytes(&self, module_name: &str) -> PamResult<Vec<u8>>
fn retrieve_bytes(&self, module_name: &str) -> PamResult<Vec<u8>>
Retrieve bytes previously stored with send_bytes
.
The result is a clone of the data. Read more
Auto Trait Implementations
impl RefUnwindSafe for Pam
impl !Send for Pam
impl !Sync for Pam
impl Unpin for Pam
impl UnwindSafe for Pam
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more