# HG changeset patch # User Paul Fisher # Date 1752520036 14400 # Node ID 180237d0b4988519fb5f445e5c71c4aa819eca67 # Parent e9354e655f38183ae1cb920b46cee90a0b1a02b4 Improve README files for libpam-sys and libpam-sys-consts. diff -r e9354e655f38 -r 180237d0b498 libpam-sys/README.md --- a/libpam-sys/README.md Sun Jul 13 16:06:51 2025 -0400 +++ b/libpam-sys/README.md Mon Jul 14 15:07:16 2025 -0400 @@ -1,7 +1,9 @@ # `libpam-sys`: low-level bindings to Pluggable Authentication Modules -This crate provides low-level access to PAM, working with multiple PAM implementations. -You do not need PAM system headers installed to use this! +- Supports all known PAM implementations on Linux, Mac OS, BSD, and Illumos/Solaris +- Works with zero configuration for common use cases +- No need for system header files +- Depends only on `libc` If you're looking for a nice, safe, Rusty API to PAM, may I recommend [nonstick]? diff -r e9354e655f38 -r 180237d0b498 libpam-sys/libpam-sys-consts/README.md --- a/libpam-sys/libpam-sys-consts/README.md Sun Jul 13 16:06:51 2025 -0400 +++ b/libpam-sys/libpam-sys-consts/README.md Mon Jul 14 15:07:16 2025 -0400 @@ -1,19 +1,24 @@ # `libpam-sys-consts`: Constants for LibPAM +This is mostly a backend crate for [libpam-sys](https://crates.io/crates/libpam-sys/). +That crate re-exports pretty much everything we provide. +In most cases, you can just use that instead of depending upon this directly. + This crate does two primary things: -- Detects which implementation of LibPAM the current machine uses (as part of the build script), and exports that information to downstream crates. +- Detects which implementation of LibPAM to use (as part of the build script), and exports that information to downstream crates. - Exports the constants specific to that version of LibPAM. These are located in the `constants` module. -## Handling different PAM implmementations +## Handling different PAM implementations Different PAM implementations have different constants and some different behaviors. If you need to change your library's behavior based on PAM implementation, there are a few ways to do so. ### Constants -The current PAM implementation is available in `PamImpl::CURRENT`. +You can match on the current PAM implementation at runtime. +All known PAM implementations are in the `PamImpl` enumeration, and `PamImpl::CURRENT` is set to the current implementation. This is present as a string literal macro in `pam_impl_name!`. ### Conditional compilation @@ -57,7 +62,7 @@ If we don't know what kind of PAM is usually installed on this OS, we fall back to `__installed__`. - `__installed__`: Looks at the PAM library installed on the current machine. If none is recognized, falls back to `XSso`. -- The name of a `PamEnum` entry: The named PAM implementation. +- The name of a `PamImpl` entry: The named PAM implementation. For instance, `LIBPAMSYS_IMPL=OpenPam cargo build` will build this library for OpenPAM. ## MSRV