annotate testharness/src/lib.rs @ 159:634cd5f2ac8b

Separate logging into its own trait apart from the rest of PAM.
author Paul Fisher <paul@pfish.zone>
date Sat, 12 Jul 2025 18:16:18 -0400
parents 1bc52025156b
children a75a66cb4181
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
1 //! The nonstick library
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
2 extern crate nonstick;
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
3
146
1bc52025156b Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents: 127
diff changeset
4 use nonstick::{pam_hooks, Flags, ModuleClient, PamModule};
104
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
5 use std::ffi::CStr;
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
6
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
7 struct TestHarness;
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
8
146
1bc52025156b Split PAM items into their own separate struct.
Paul Fisher <paul@pfish.zone>
parents: 127
diff changeset
9 impl<M: ModuleClient> PamModule<M> for TestHarness {
123
98a624cacd82 Get rid of all the warnings, and arrange attributes.
Paul Fisher <paul@pfish.zone>
parents: 104
diff changeset
10 fn authenticate(_handle: &mut M, _args: Vec<&CStr>, _flags: Flags) -> nonstick::Result<()> {
104
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
11 Ok(())
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
12 }
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
13
127
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 123
diff changeset
14 fn account_management(
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 123
diff changeset
15 _handle: &mut M,
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 123
diff changeset
16 _args: Vec<&CStr>,
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 123
diff changeset
17 _flags: Flags,
c77846f3a979 GET CTEST WORKING.
Paul Fisher <paul@pfish.zone>
parents: 123
diff changeset
18 ) -> nonstick::Result<()> {
104
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
19 Ok(())
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
20 }
159
634cd5f2ac8b Separate logging into its own trait apart from the rest of PAM.
Paul Fisher <paul@pfish.zone>
parents: 146
diff changeset
21
634cd5f2ac8b Separate logging into its own trait apart from the rest of PAM.
Paul Fisher <paul@pfish.zone>
parents: 146
diff changeset
22 fn change_authtok(_handle: &mut M, _args: Vec<&CStr>, _flags: Flags) -> nonstick::Result<()> {
634cd5f2ac8b Separate logging into its own trait apart from the rest of PAM.
Paul Fisher <paul@pfish.zone>
parents: 146
diff changeset
23 todo!()
634cd5f2ac8b Separate logging into its own trait apart from the rest of PAM.
Paul Fisher <paul@pfish.zone>
parents: 146
diff changeset
24 }
104
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
25 }
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
26
a2676475e86b Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff changeset
27 pam_hooks!(TestHarness);