summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2a1f0ea..7190e51 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -50,11 +50,11 @@ fn safe_to_string<T: MaxDisplayLength>(v: T) -> Result<String, SessionError> {
Ok(buf)
}
-fn open_session(h: &mut PamHandle) -> Result<(), SessionError> {
+fn open_session(h: &mut PamHandle, mountpoint: &str) -> Result<(), SessionError> {
let user = h.get_user(None).or(Err(SessionError))?;
let user = users::get_user_by_name(&user).ok_or(SessionError)?;
let uid = safe_to_string(user.uid())?;
- let d = Dir::open_ambient_dir(CG_MOUNT, cap_std::ambient_authority())?;
+ let d = Dir::open_ambient_dir(mountpoint, cap_std::ambient_authority())?;
let d = create_and_open_dir(&d, "user")?;
let d = create_and_open_dir(&d, &uid)?;
let d = create_and_open_dir(&d, "leaf")?;
@@ -72,7 +72,7 @@ impl PamHooks for PAMUserCG {
_args: Vec<&CStr>,
_flags: PamFlag,
) -> PamResultCode {
- match open_session(h) {
+ match open_session(h, CG_MOUNT) {
Ok(()) => PamResultCode::PAM_SUCCESS,
Err(SessionError) => PamResultCode::PAM_SESSION_ERR,
}