[−][src]Trait pamsm::PamLibExt
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>>
&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
Implementors
impl PamLibExt for Pam
[src]
fn get_user(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
[src]
fn get_cached_user(&self) -> PamResult<Option<&CStr>>
[src]
fn get_cached_authtok(&self) -> PamResult<Option<&CStr>>
[src]
fn get_authtok(&self, prompt: Option<&str>) -> PamResult<Option<&CStr>>
[src]
fn set_authtok(&self, authtok: &CString) -> PamResult<()>
[src]
fn get_rhost(&self) -> PamResult<Option<&CStr>>
[src]
fn get_ruser(&self) -> PamResult<Option<&CStr>>
[src]
fn conv(
&self,
prompt: Option<&str>,
style: PamMsgStyle
) -> PamResult<Option<&CStr>>
[src]
&self,
prompt: Option<&str>,
style: PamMsgStyle
) -> PamResult<Option<&CStr>>