From 1d77b6cf6be41b43fe2e6ba184c09958f08f6301 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 15 Feb 2019 10:32:14 +0100 Subject: [PATCH] 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 --- Cargo.toml | 2 +- src/api2/access.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 13ede986..8d5c354e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,4 +38,4 @@ walkdir = "2" md5 = "0.6" base64 = "0.10" pam-sys = "0.5" -pam-auth = "0.5" +pam = "0.7" diff --git a/src/api2/access.rs b/src/api2/access.rs index 361e445c..24811fb1 100644 --- a/src/api2/access.rs +++ b/src/api2/access.rs @@ -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(()); }