Mercurial > crates > nonstick
diff src/lib.rs @ 171:e27c5c667a5a
Create full new types for return code and flags, separate end to end.
This plumbs the ReturnCode and RawFlags types through the places where
we call into or are called from PAM.
Also adds Sun documentation to the project.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Fri, 25 Jul 2025 20:52:14 -0400 |
parents | 2f5913131295 |
children | 46e8ce5cd5d1 |
line wrap: on
line diff
--- a/src/lib.rs Wed Jul 16 18:45:20 2025 -0400 +++ b/src/lib.rs Fri Jul 25 20:52:14 2025 -0400 @@ -22,8 +22,30 @@ //! //! [module-guide]: https://www.chiark.greenend.org.uk/doc/libpam-doc/html/Linux-PAM_MWG.html -// Temporary until everything is fully wired up. -#![allow(dead_code)] +#[cfg(feature = "link")] +mod _compat_checker { + macro_rules! feature_check { + ($feature:literal, pam_impl = ($($pimpl:literal),*)) => { + #[cfg(all(feature = $feature, not(any($(pam_impl = $pimpl),*))))] + compile_error!( + concat!( + "The feature '", $feature, "' is only available ", + "with these PAM implementations:\n", + $("- ", $pimpl, "\n"),*, + "The current PAM implementation is:\n\n", + " ", libpam_sys::pam_impl_name!(), "\n\n", + "Set the 'LIBPAMSYS_IMPL' environment variable to one of ", + "the above PAM implementation names to build ", + "for that implementation of PAM." + ) + ); + } + } + feature_check!("linux-pam-ext", pam_impl = ("LinuxPam")); + feature_check!("basic-ext", pam_impl = ("LinuxPam", "OpenPam")); + feature_check!("openpam-ext", pam_impl = ("OpenPam")); + feature_check!("sun-ext", pam_impl = ("Sun")); +} pub mod constants; pub mod conv; @@ -39,8 +61,11 @@ pub mod logging; #[cfg(feature = "link")] +#[doc(hidden)] +pub use crate::libpam::ModuleExporter; +#[cfg(feature = "link")] #[doc(inline)] -pub use crate::libpam::{LibPamHandle, LibPamTransaction}; +pub use crate::libpam::{LibPamHandle, LibPamTransaction, TransactionBuilder}; #[doc(inline)] pub use crate::{ constants::{