summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2023-01-27 16:33:41 +0000
committerTomasz Kramkowski <tomasz@kramkow.ski>2023-01-27 17:08:58 +0000
commit3830358ad433b9d931416445a66fe32e9713e8c5 (patch)
treeb8914c101233d4251384490caa8205334aec65a0 /src/lib.rs
parent18dba05104304778ed1939b23a1f6c078e683e51 (diff)
downloadpam_usercg_rust-3830358ad433b9d931416445a66fe32e9713e8c5.tar.gz
pam_usercg_rust-3830358ad433b9d931416445a66fe32e9713e8c5.tar.xz
pam_usercg_rust-3830358ad433b9d931416445a66fe32e9713e8c5.zip
reshuffle
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 7190e51..6f6407a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,11 +10,6 @@ use std::io::{ErrorKind, Write};
use std::path::Path;
use std::process;
-const CG_MOUNT: &str = "/sys/fs/cgroup";
-
-struct PAMUserCG;
-pam::pam_hooks!(PAMUserCG);
-
fn create_and_open_dir<P: AsRef<Path> + Copy>(
d: &Dir,
path: P,
@@ -66,6 +61,11 @@ fn open_session(h: &mut PamHandle, mountpoint: &str) -> Result<(), SessionError>
Ok(())
}
+const CG_MOUNT: &str = "/sys/fs/cgroup";
+
+struct PAMUserCG;
+pam::pam_hooks!(PAMUserCG);
+
impl PamHooks for PAMUserCG {
fn sm_open_session(
h: &mut PamHandle,