comparison src/lib.rs @ 176:0730f5f2ee2a

Turn `libpam-sys-consts` back into `libpam-sys-impls`. This moves the constants into `libpam-sys` and makes `libpam-sys-impls` responsible solely for detecting the current PAM implementation.
author Paul Fisher <paul@pfish.zone>
date Wed, 30 Jul 2025 17:53:31 -0400
parents e30775c80b49
children 4f46681b3f54
comparison
equal deleted inserted replaced
175:e30775c80b49 176:0730f5f2ee2a
81 //! 81 //!
82 //! PAM modules are implemented as dynamic libraries loaded into 82 //! PAM modules are implemented as dynamic libraries loaded into
83 //! the address space of the calling application. To implement a module, 83 //! the address space of the calling application. To implement a module,
84 //! create a `dylib` crate and implement a [`PamModule`], and export it 84 //! create a `dylib` crate and implement a [`PamModule`], and export it
85 //! using the [`pam_export!`] macro. 85 //! using the [`pam_export!`] macro.
86 //!
87 //! ```toml 86 //! ```toml
88 //! ## Your Cargo.toml 87 //! ## Your Cargo.toml
89 //! [package] 88 //! [package]
90 //! name = "example-package" 89 //! name = "example-package"
91 //! ## ... 90 //! ## ...
92 //! 91 //!
93 //! [lib] 92 //! [lib]
94 //! crate-type = ["cdylib"] 93 //! crate-type = ["cdylib"]
95 //! ``` 94 //! ```
96 //!
97 //! ``` 95 //! ```
98 //! // Your lib.rs 96 //! // Your lib.rs
99 //! 97 //!
100 //! use nonstick::{ 98 //! use nonstick::{
101 //! pam_export, AuthnFlags, ErrorCode, ModuleClient, PamModule, Result as PamResult, 99 //! pam_export, AuthnFlags, ErrorCode, ModuleClient, PamModule, Result as PamResult,
125 //! 123 //!
126 //! // You can implement other methods of PamModule to provide additional 124 //! // You can implement other methods of PamModule to provide additional
127 //! // features. 125 //! // features.
128 //! } 126 //! }
129 //! ``` 127 //! ```
130 //! 128 //!
131 //! This gets built into a library like `pam_samename.so`. By installing this 129 //! This gets built into a library like `pam_samename.so`. By installing this
132 //! into your PAM library directory and configuring PAM to use it in 130 //! into your PAM library directory and configuring PAM to use it in
133 //! the authentication stack (beyond the scope of this documentation), it will 131 //! the authentication stack (beyond the scope of this documentation), it will
134 //! be used to authenticate users. 132 //! be used to authenticate users.
135 //! 133 //!
156 //! - PAM framework man page for system administrators: 154 //! - PAM framework man page for system administrators:
157 //! - [Linux-PAM admin documentation][man7pam8] 155 //! - [Linux-PAM admin documentation][man7pam8]
158 //! - [OpenPAM admin documentation][bsdpam8] 156 //! - [OpenPAM admin documentation][bsdpam8]
159 //! - [Illumos pam.conf documentation][sunpam5] 157 //! - [Illumos pam.conf documentation][sunpam5]
160 //! - [The original PAM specification][spec] (mostly of historical interest) 158 //! - [The original PAM specification][spec] (mostly of historical interest)
159 #![doc = ""]
161 #![doc = crate::_doc::man7!(man7pam8: 8 pam)] 160 #![doc = crate::_doc::man7!(man7pam8: 8 pam)]
162 #![doc = crate::_doc::manbsd!(bsdpam8: 8 pam)] 161 #![doc = crate::_doc::manbsd!(bsdpam8: 8 pam)]
163 #![doc = crate::_doc::mansun!(sunpam5: 5 "pam.conf")] 162 #![doc = crate::_doc::mansun!(sunpam5: 5 "pam.conf")]
164 #![doc = crate::_doc::stdlinks!(3 pam)] 163 #![doc = crate::_doc::stdlinks!(3 pam)]
165 #![doc = crate::_doc::guide!(adg: "Linux-PAM_ADG.html")] 164 #![doc = crate::_doc::guide!(adg: "Linux-PAM_ADG.html")]
216 conv::{BinaryData, Conversation, ConversationAdapter}, 215 conv::{BinaryData, Conversation, ConversationAdapter},
217 environ::{EnvironMap, EnvironMapMut}, 216 environ::{EnvironMap, EnvironMapMut},
218 handle::{ModuleClient, PamShared, Transaction}, 217 handle::{ModuleClient, PamShared, Transaction},
219 module::PamModule, 218 module::PamModule,
220 }; 219 };
221 use libpam_sys_consts::pam_impl_name; 220 use libpam_sys_impls::pam_impl_name;