diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-01-27 14:30:28 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-01-27 14:30:28 +0000 |
commit | 8c30492c7a186414df01dade43024d1c73f20b4c (patch) | |
tree | f6d92c111e529177c2e329dd25bf2a965243313c /src | |
parent | bdd8126b938de11272f79bb7f512316740469ed7 (diff) | |
download | pam_usercg_rust-8c30492c7a186414df01dade43024d1c73f20b4c.tar.gz pam_usercg_rust-8c30492c7a186414df01dade43024d1c73f20b4c.tar.xz pam_usercg_rust-8c30492c7a186414df01dade43024d1c73f20b4c.zip |
formatting
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 |