diff options
-rw-r--r-- | src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -53,10 +53,9 @@ impl PamHooks for PAMUserCG { _args: Vec<&CStr>, _flags: PamFlag, ) -> PamResultCode { - if open_session(h).is_ok() { - PamResultCode::PAM_SUCCESS - } else { - PamResultCode::PAM_SESSION_ERR + match open_session(h) { + Ok(()) => PamResultCode::PAM_SUCCESS, + Err(SessionError) => PamResultCode::PAM_SESSION_ERR, } } } |