Mercurial > crates > nonstick
comparison pam-sober/src/lib.rs @ 26:31618a75f251
Merge pull request #3 from clee/fix-pam-sober-message
Fix pam-sober message (not using HTTP)
author | Anthony Nowell <anowell@gmail.com> |
---|---|
date | Thu, 19 Apr 2018 14:08:54 -0600 |
parents | d5c842a50827 |
children | ec70822cbdef |
comparison
equal
deleted
inserted
replaced
24:f6bde5107e48 | 26:31618a75f251 |
---|---|
30 pam_hooks!(PamSober); | 30 pam_hooks!(PamSober); |
31 | 31 |
32 impl PamHooks for PamSober { | 32 impl PamHooks for PamSober { |
33 // This function performs the task of authenticating the user. | 33 // This function performs the task of authenticating the user. |
34 fn sm_authenticate(pamh: &PamHandle, _args: Vec<&CStr>, _flags: PamFlag) -> PamResultCode { | 34 fn sm_authenticate(pamh: &PamHandle, _args: Vec<&CStr>, _flags: PamFlag) -> PamResultCode { |
35 println!("Let's auth over HTTP"); | 35 println!("Let's make sure you're sober enough to perform basic addition"); |
36 | 36 |
37 /* TODO: use args to change difficulty ;-) | 37 /* TODO: use args to change difficulty ;-) |
38 let args: HashMap<&str, &str> = args.iter().map(|s| { | 38 let args: HashMap<&str, &str> = args.iter().map(|s| { |
39 let mut parts = s.splitn(2, "="); | 39 let mut parts = s.splitn(2, "="); |
40 (parts.next().unwrap(), parts.next().unwrap_or("")) | 40 (parts.next().unwrap(), parts.next().unwrap_or("")) |