view testharness/src/lib.rs @ 136:efbc235f01d3 default tip

Separate libpam-sys-helpers from libpam-sys. This separates the parts of libpam-sys that don't need linking against libpam from the parts that do need to link against libpam.
author Paul Fisher <paul@pfish.zone>
date Thu, 03 Jul 2025 14:28:04 -0400
parents c77846f3a979
children
line wrap: on
line source

//! The nonstick library
extern crate nonstick;

use nonstick::{pam_hooks, Flags, PamHandleModule, PamModule};
use std::ffi::CStr;

struct TestHarness;

impl<M: PamHandleModule> 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);