Mercurial > crates > nonstick
comparison src/libpam/mod.rs @ 75:c30811b4afae
rename pam_ffi submodule to libpam.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Fri, 06 Jun 2025 22:35:08 -0400 |
parents | src/pam_ffi/mod.rs@c7c596e6388f |
children | 002adfb98c5c |
comparison
equal
deleted
inserted
replaced
74:c7c596e6388f | 75:c30811b4afae |
---|---|
1 //! The PAM library FFI and helpers for managing it. | |
2 //! | |
3 //! This includes the functions provided by PAM and the data structures | |
4 //! used by PAM, as well as a few low-level abstractions for dealing with | |
5 //! those data structures. | |
6 //! | |
7 //! Everything in here is hazmat. | |
8 //! | |
9 | |
10 #![allow(dead_code)] | |
11 | |
12 mod conversation; | |
13 mod handle; | |
14 mod memory; | |
15 mod message; | |
16 mod module; | |
17 mod response; | |
18 | |
19 pub use handle::{LibPamHandle, OwnedLibPamHandle}; | |
20 use std::ffi::{c_char, c_int, c_void}; | |
21 | |
22 #[link(name = "pam")] | |
23 extern "C" { | |
24 fn pam_get_data( | |
25 pamh: *mut LibPamHandle, | |
26 module_data_name: *const c_char, | |
27 data: &mut *const c_void, | |
28 ) -> c_int; | |
29 | |
30 fn pam_set_data( | |
31 pamh: *mut LibPamHandle, | |
32 module_data_name: *const c_char, | |
33 data: *const c_void, | |
34 cleanup: extern "C" fn(pamh: *const c_void, data: *mut c_void, error_status: c_int), | |
35 ) -> c_int; | |
36 | |
37 fn pam_get_item(pamh: *mut LibPamHandle, item_type: c_int, item: &mut *const c_void) -> c_int; | |
38 | |
39 fn pam_set_item(pamh: *mut LibPamHandle, item_type: c_int, item: *const c_void) -> c_int; | |
40 | |
41 fn pam_get_user( | |
42 pamh: *mut LibPamHandle, | |
43 user: &mut *const c_char, | |
44 prompt: *const c_char, | |
45 ) -> c_int; | |
46 | |
47 fn pam_get_authtok( | |
48 pamh: *mut LibPamHandle, | |
49 item_type: c_int, | |
50 data: &mut *const c_char, | |
51 prompt: *const c_char, | |
52 ) -> c_int; | |
53 | |
54 fn pam_end(pamh: *mut LibPamHandle, status: c_int) -> c_int; | |
55 | |
56 // TODO: pam_authenticate - app | |
57 // pam_setcred - app | |
58 // pam_acct_mgmt - app | |
59 // pam_chauthtok - app | |
60 // pam_open_session - app | |
61 // pam_close_session - app | |
62 // pam_putenv - shared | |
63 // pam_getenv - shared | |
64 // pam_getenvlist - shared | |
65 } |