diff --git a/Cargo.toml b/Cargo.toml index b335170..08742ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pamsm" -version = "0.4.1" +version = "0.4.2" description = "Rust wrappers around PAM Service Modules functions" authors = ["Raphael Catolino "] license = "GPL-3.0" diff --git a/src/libpam.rs b/src/libpam.rs index 3c653ac..af993d0 100644 --- a/src/libpam.rs +++ b/src/libpam.rs @@ -61,6 +61,9 @@ pub trait PamLibExt: private::Sealed { /// Get the cached authentication token. fn get_cached_authtok(&self) -> PamResult>; + /// Get the cached old authentication token. + fn get_cached_oldauthtok(&self) -> PamResult>; + /// 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 get_authtok(&self, prompt: Option<&str>) -> PamResult>; @@ -125,6 +128,10 @@ impl PamLibExt for Pam { self.get_cstr_item(PamItemType::AUTHTOK) } + fn get_cached_oldauthtok(&self) -> PamResult> { + self.get_cstr_item(PamItemType::OLDAUTHTOK) + } + fn get_authtok(&self, prompt: Option<&str>) -> PamResult> { let cprompt = match prompt { None => None,