Trait pam_client::ConversationHandler [−][src]
Trait for PAM conversation functions
Implement this for custom behaviour when a PAM module asks for usernames, passwords, etc. or wants to show a message to the user
Required methods
fn prompt_echo_on(&mut self, prompt: &CStr) -> Result<CString, ReturnCode>
[src]
Obtains a string whilst echoing text (e.g. username)
Errors
You should return one of the following error codes on failure.
ReturnCode::CONV_ERR
: Conversation failure.ReturnCode::BUF_ERR
: Memory allocation error.ReturnCode::CONV_AGAIN
: no result yet, the PAM library should passReturnCode::INCOMPLETE
to the application and let it try again later.
fn prompt_echo_off(&mut self, prompt: &CStr) -> Result<CString, ReturnCode>
[src]
Obtains a string without echoing any text (e.g. password)
Errors
You should return one of the following error codes on failure.
ReturnCode::CONV_ERR
: Conversation failure.ReturnCode::BUF_ERR
: Memory allocation error.ReturnCode::CONV_AGAIN
: no result yet, the PAM library should passReturnCode::INCOMPLETE
to the application and let it try again later.
fn text_info(&mut self, msg: &CStr)
[src]
Displays some text.
fn error_msg(&mut self, msg: &CStr)
[src]
Displays an error message.
Provided methods
fn init(&mut self, _default_user: Option<impl AsRef<str>>)
[src]
Called by Context
directly after taking ownership
of the handler.
May be called multiple times if
Context::replace_conversation()
is used. In this case it is called each time a context takes ownership
and passed the current target username of that context (if any) as the
argument.
The default implementation does nothing.