Mercurial > crates > nonstick
comparison libpam-sys/libpam-sys-consts/README.md @ 162:180237d0b498
Improve README files for libpam-sys and libpam-sys-consts.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Mon, 14 Jul 2025 15:07:16 -0400 |
parents | e9354e655f38 |
children |
comparison
equal
deleted
inserted
replaced
161:e9354e655f38 | 162:180237d0b498 |
---|---|
1 # `libpam-sys-consts`: Constants for LibPAM | 1 # `libpam-sys-consts`: Constants for LibPAM |
2 | |
3 This is mostly a backend crate for [libpam-sys](https://crates.io/crates/libpam-sys/). | |
4 That crate re-exports pretty much everything we provide. | |
5 In most cases, you can just use that instead of depending upon this directly. | |
2 | 6 |
3 This crate does two primary things: | 7 This crate does two primary things: |
4 | 8 |
5 - Detects which implementation of LibPAM the current machine uses (as part of the build script), and exports that information to downstream crates. | 9 - Detects which implementation of LibPAM to use (as part of the build script), and exports that information to downstream crates. |
6 - Exports the constants specific to that version of LibPAM. | 10 - Exports the constants specific to that version of LibPAM. |
7 These are located in the `constants` module. | 11 These are located in the `constants` module. |
8 | 12 |
9 ## Handling different PAM implmementations | 13 ## Handling different PAM implementations |
10 | 14 |
11 Different PAM implementations have different constants and some different behaviors. | 15 Different PAM implementations have different constants and some different behaviors. |
12 If you need to change your library's behavior based on PAM implementation, there are a few ways to do so. | 16 If you need to change your library's behavior based on PAM implementation, there are a few ways to do so. |
13 | 17 |
14 ### Constants | 18 ### Constants |
15 | 19 |
16 The current PAM implementation is available in `PamImpl::CURRENT`. | 20 You can match on the current PAM implementation at runtime. |
21 All known PAM implementations are in the `PamImpl` enumeration, and `PamImpl::CURRENT` is set to the current implementation. | |
17 This is present as a string literal macro in `pam_impl_name!`. | 22 This is present as a string literal macro in `pam_impl_name!`. |
18 | 23 |
19 ### Conditional compilation | 24 ### Conditional compilation |
20 | 25 |
21 This package provides custom `#[cfg]`s to compile based on the current PAM implementation. | 26 This package provides custom `#[cfg]`s to compile based on the current PAM implementation. |
55 | 60 |
56 - Unset or empty (the default): Use the version of PAM most commonly found on the target OS. | 61 - Unset or empty (the default): Use the version of PAM most commonly found on the target OS. |
57 If we don't know what kind of PAM is usually installed on this OS, we fall back to `__installed__`. | 62 If we don't know what kind of PAM is usually installed on this OS, we fall back to `__installed__`. |
58 - `__installed__`: Looks at the PAM library installed on the current machine. | 63 - `__installed__`: Looks at the PAM library installed on the current machine. |
59 If none is recognized, falls back to `XSso`. | 64 If none is recognized, falls back to `XSso`. |
60 - The name of a `PamEnum` entry: The named PAM implementation. | 65 - The name of a `PamImpl` entry: The named PAM implementation. |
61 For instance, `LIBPAMSYS_IMPL=OpenPam cargo build` will build this library for OpenPAM. | 66 For instance, `LIBPAMSYS_IMPL=OpenPam cargo build` will build this library for OpenPAM. |
62 | 67 |
63 ## MSRV | 68 ## MSRV |
64 | 69 |
65 This library supports **Rust 1.75**, as the version currently (July 2025) available in Debian Trixie and Ubuntu 24.04 LTS. | 70 This library supports **Rust 1.75**, as the version currently (July 2025) available in Debian Trixie and Ubuntu 24.04 LTS. |