Mercurial > crates > nonstick
view testharness/src/lib.rs @ 153:3036f2e6a022
Add module-specific data support.
This adds support for a safe form of `pam_get_data` and `pam_set_data`,
where data is (as best as humanly possible) type-safe and restricted
to only the module where it was created.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 08 Jul 2025 00:31:54 -0400 |
parents | 1bc52025156b |
children |
line wrap: on
line source
//! The nonstick library extern crate nonstick; use nonstick::{pam_hooks, Flags, ModuleClient, PamModule}; use std::ffi::CStr; struct TestHarness; impl<M: ModuleClient> PamModule<M> for TestHarness { fn authenticate(_handle: &mut M, _args: Vec<&CStr>, _flags: Flags) -> nonstick::Result<()> { Ok(()) } fn account_management( _handle: &mut M, _args: Vec<&CStr>, _flags: Flags, ) -> nonstick::Result<()> { Ok(()) } } pam_hooks!(TestHarness);