[][src]Trait pamsm::PamLibExt

pub trait PamLibExt: Sealed {
    fn get_user(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>;
fn get_cached_user(&self) -> PamResult<Option<&CStr>>;
fn get_cached_authtok(&self) -> PamResult<Option<&CStr>>;
fn get_authtok(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>;
fn set_authtok(&self, authtok: &CString) -> PamResult<()>;
fn get_rhost(&self) -> PamResult<Option<&CStr>>;
fn get_ruser(&self) -> PamResult<Option<&CStr>>;
fn conv(
        &self,
        prompt: Option<&str>,
        style: PamMsgStyle
    ) -> PamResult<Option<&CStr>>; }

Extension trait over Pam, usually provided by the libpam shared library.

Required methods

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

fn get_cached_user(&self) -> PamResult<Option<&CStr>>

Get the username, i.e. the PAM_USER item. If it's not set return None.

fn get_cached_authtok(&self) -> PamResult<Option<&CStr>>

Get the cached authentication token.

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

fn set_authtok(&self, authtok: &CString) -> PamResult<()>

fn get_rhost(&self) -> PamResult<Option<&CStr>>

Get the remote hostname.

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

Get the remote username.

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

Loading content...

Implementors

impl PamLibExt for Pam[src]

Loading content...