view testharness/src/lib.rs @ 161:e9354e655f38

Improve PAM detection docs.
author Paul Fisher <paul@pfish.zone>
date Sun, 13 Jul 2025 16:06:51 -0400
parents 634cd5f2ac8b
children a75a66cb4181
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(())
    }

    fn change_authtok(_handle: &mut M, _args: Vec<&CStr>, _flags: Flags) -> nonstick::Result<()> {
        todo!()
    }
}

pam_hooks!(TestHarness);