diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -12,14 +12,15 @@ struct PAMUserCG; pam::pam_hooks!(PAMUserCG); fn create_and_open_dir<P: AsRef<Path> + Copy>( - d: &Dir, path: P, - ) -> std::io::Result<Dir> { + d: &Dir, + path: P, +) -> std::io::Result<Dir> { match d.create_dir(path) { Ok(()) => Ok(()), Err(e) => match e.kind() { ErrorKind::AlreadyExists => Ok(()), _ => Err(e), - } + }, }?; d.open_dir(path) } @@ -47,7 +48,7 @@ impl PamHooks for PAMUserCG { fn sm_open_session( h: &mut PamHandle, _args: Vec<&CStr>, - _flags: PamFlag + _flags: PamFlag, ) -> PamResultCode { if open_session(h).is_ok() { PamResultCode::PAM_SUCCESS |