update to pam 0.7 (renamed from pam-auth)
It now supports custom conversation methods, so instead of new() we ask for a default authenticator taking a password via with_password(). Since the password is now handled by the now separate conversation handler, `set_credentials()` is now called on the handler we get via `.get_handler()`. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -13,8 +13,8 @@ use serde_json::{json, Value};
|
||||
fn authenticate_user(username: &str, password: &str) -> Result<(), Error> {
|
||||
|
||||
if username == "root@pam" {
|
||||
let mut auth = pam_auth::Authenticator::new("proxmox-backup-auth").unwrap();
|
||||
auth.set_credentials("root", password);
|
||||
let mut auth = pam::Authenticator::with_password("proxmox-backup-auth").unwrap();
|
||||
auth.get_handler().set_credentials("root", password);
|
||||
auth.authenticate()?;
|
||||
return Ok(());
|
||||
}
|
||||
|
Reference in New Issue
Block a user