Mercurial > crates > nonstick
comparison testharness/src/lib.rs @ 146:1bc52025156b
Split PAM items into their own separate struct.
To trim down the number of methods on `PamShared`, this puts all the
Items into their own struct(s). This also makes the split between
authtok/authtok_item easier to understand.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sun, 06 Jul 2025 19:10:26 -0400 |
parents | c77846f3a979 |
children |
comparison
equal
deleted
inserted
replaced
145:8f964b701652 | 146:1bc52025156b |
---|---|
1 //! The nonstick library | 1 //! The nonstick library |
2 extern crate nonstick; | 2 extern crate nonstick; |
3 | 3 |
4 use nonstick::{pam_hooks, Flags, PamHandleModule, PamModule}; | 4 use nonstick::{pam_hooks, Flags, ModuleClient, PamModule}; |
5 use std::ffi::CStr; | 5 use std::ffi::CStr; |
6 | 6 |
7 struct TestHarness; | 7 struct TestHarness; |
8 | 8 |
9 impl<M: PamHandleModule> PamModule<M> for TestHarness { | 9 impl<M: ModuleClient> PamModule<M> for TestHarness { |
10 fn authenticate(_handle: &mut M, _args: Vec<&CStr>, _flags: Flags) -> nonstick::Result<()> { | 10 fn authenticate(_handle: &mut M, _args: Vec<&CStr>, _flags: Flags) -> nonstick::Result<()> { |
11 Ok(()) | 11 Ok(()) |
12 } | 12 } |
13 | 13 |
14 fn account_management( | 14 fn account_management( |