comparison libpam-sys/README.md @ 160:09dff285ff5e

Switch default PAM detection strategy to target-based. To make cross-compilation easier (like for docs.rs), this change makes OS-based detection of PAM the default, only falling back to probing the actual installed PAM as a last resort. I haven't been able to find a Linux distribution that uses anything but Linux-PAM.
author Paul Fisher <paul@pfish.zone>
date Sun, 13 Jul 2025 15:38:00 -0400
parents d5b7b28d754e
children e9354e655f38
comparison
equal deleted inserted replaced
159:634cd5f2ac8b 160:09dff285ff5e
1 # `libpam-sys`: low-level bindings to Pluggable Authentication Modules 1 # `libpam-sys`: low-level bindings to Pluggable Authentication Modules
2 2
3 This crate provides low-level access to PAM, working with multiple PAM implementations. 3 This crate provides low-level access to PAM, working with multiple PAM implementations.
4 You do not need PAM system headers installed to use this! 4 You do not need PAM system headers installed to use this!
5 5
6 If you're looking for a nice, safe, Rusty API to PAM, may I recommend [nonstick][nonstick]? 6 If you're looking for a nice, safe, Rusty API to PAM, may I recommend [nonstick]?
7 7
8 ## PAM implementations 8 ## PAM implementations
9 9
10 This crate detects the PAM implementation you have installed, or guesses based on the OS if that's unavailable.
11 Supported PAM implementations are defined in the `pam_impl::PamImpl` enum. 10 Supported PAM implementations are defined in the `pam_impl::PamImpl` enum.
12 11
12 This crate automatically chooses the appropriate PAM implementation you are most likely to need installed based on the target OS.
13 You can also explicitly specify the PAM implementation you want (if not detected correctly) by setting the `LIBPAMSYS_IMPL` environment variable **at build time**. 13 You can also explicitly specify the PAM implementation you want (if not detected correctly) by setting the `LIBPAMSYS_IMPL` environment variable **at build time**.
14 All build-time configuration is performed by the build script of the [`libpam-sys-consts` crate](https://crates.io/crates/libpam-sys-consts). 14 All build-time configuration is performed by the build script of the [`libpam-sys-consts` crate](https://crates.io/crates/libpam-sys-consts).
15 15
16 Each implementation exports all the functionality available in its respective PAM library. 16 Normally, this crate exports all functionality available in the selected PAM library.
17 `XSso` exports only the subset of the [X/SSO specification][xsso] supported by both OpenPAM and Sun PAM. 17 `XSso` exports only the subset of the [X/SSO specification][xsso] supported by both OpenPAM and Sun PAM.
18 18
19 ## Testing 19 ## Testing
20 20
21 Tests are mostly run through `libpam-sys-test`, which lives in the crate's workspace in its repository (along with [nonstick]). 21 Tests are mostly run through `libpam-sys-test`, which lives in the crate's workspace in its repository (along with [nonstick]).