Skip to content

Commit

Permalink
Update README as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
regiontog authored and 1wilkens committed May 28, 2019
1 parent 69f018e commit 11c4842
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn main() {
let password = "<pass>";

let mut auth = pam::Authenticator::with_password(service).unwrap();
auth.get_handler().set_credentials(user, password);
auth.mut_handler().set_credentials(user, password);
if auth.authenticate().is_ok() && auth.open_session().is_ok() {
println!("Successfully opened a session!");
}
Expand Down
4 changes: 2 additions & 2 deletions src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{env::get_pam_env, ffi, Converse, PamError, PamResult, PasswordConv};
/// let mut authenticator = Authenticator::with_password("system-auth")
/// .expect("Failed to init PAM client.");
/// // Preset the login & password we will use for authentication
/// authenticator.get_handler().set_credentials("login", "password");
/// authenticator.mut_handler().set_credentials("login", "password");
/// // actually try to authenticate:
/// authenticator.authenticate().expect("Authentication failed!");
/// // Now that we are authenticated, it's possible to open a sesssion:
Expand All @@ -30,7 +30,7 @@ use crate::{env::get_pam_env, ffi, Converse, PamError, PamResult, PasswordConv};
/// If you wish to customise the PAM conversation function, you should rather create your
/// authenticator with `Authenticator::with_handler`, providing a struct implementing the
/// `Converse` trait. You can then mutably access your conversation handler using the
/// `Authenticator::get_handler` method.
/// `Authenticator::mut_handler` method.
///
/// By default, the `Authenticator` will close any opened session when dropped. If you don't
/// want this, you can change its `close_on_drop` field to `False`.
Expand Down

0 comments on commit 11c4842

Please sign in to comment.