summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6f68c22..cf93a9c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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,
}
}
}