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]

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]

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]

Get the cached authentication token.

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]

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 get_rhost(&self) -> PamResult<Option<&CStr>>[src]

Get the remote hostname.

fn get_ruser(&self) -> PamResult<Option<&CStr>>[src]

Get the remote username.

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]

Get a variable from the pam environment list.

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]

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]

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]

Similar to send_data, but only works with Vec<u8>. The PamData trait doesn’t have to be implemented on the data, a callback can be passed as an argument instead. Read more

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.