Mercurial > crates > nonstick
comparison build.rs @ 81:a8f4718fed5d
When dynamically linking against the wrong PAM, fail.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 10 Jun 2025 01:16:39 -0400 |
parents | 5aa1a010f1e8 |
children | 73c3f8e3b49d |
comparison
equal
deleted
inserted
replaced
80:5aa1a010f1e8 | 81:a8f4718fed5d |
---|---|
17 .allowlist_function("pam_get_authtok") | 17 .allowlist_function("pam_get_authtok") |
18 .allowlist_function("pam_end") | 18 .allowlist_function("pam_end") |
19 .dynamic_link_require_all(true) | 19 .dynamic_link_require_all(true) |
20 .default_macro_constant_type(MacroTypeVariation::Signed); | 20 .default_macro_constant_type(MacroTypeVariation::Signed); |
21 | 21 |
22 let linux_builder = common_builder.clone().header_contents( | 22 let linux_builder = common_builder |
23 "linux-pam.h", | 23 .clone() |
24 r#" | 24 // This function is not available in OpenPAM. |
25 // We don't use it, but we include it so that if the user | |
26 // tries to run this against the wrong PAM library, it fails. | |
27 .allowlist_function("pam_start_confdir") | |
28 .header_contents( | |
29 "linux-pam.h", | |
30 r#" | |
25 #include <security/_pam_types.h> | 31 #include <security/_pam_types.h> |
26 #include <security/pam_appl.h> | 32 #include <security/pam_appl.h> |
27 #include <security/pam_ext.h> | 33 #include <security/pam_ext.h> |
28 #include <security/pam_modules.h> | 34 #include <security/pam_modules.h> |
29 "#, | 35 "#, |
30 ); | 36 ); |
31 let openpam_builder = common_builder.clone().header_contents( | 37 let openpam_builder = common_builder |
32 "openpam.h", | 38 .clone() |
33 r#" | 39 // This function is not available in Linux-PAM. |
40 // We don't use it, but we include it so that if the user | |
41 // tries to run this against the wrong PAM library, it fails. | |
42 .allowlist_function("pam_setenv") | |
43 .header_contents( | |
44 "openpam.h", | |
45 r#" | |
34 #include <security/openpam.h> | 46 #include <security/openpam.h> |
35 #include <security/pam_appl.h> | 47 #include <security/pam_appl.h> |
36 #include <security/pam_constants.h> | 48 #include <security/pam_constants.h> |
37 #include <security/pam_types.h> | 49 #include <security/pam_types.h> |
38 "#, | 50 "#, |
39 ); | 51 ); |
40 | 52 |
41 let (pam_impl, bindings) = { | 53 let (pam_impl, bindings) = { |
42 let bb = linux_builder.generate(); | 54 let bb = linux_builder.generate(); |
43 bb.as_ref().unwrap(); | 55 bb.as_ref().unwrap(); |
44 if let Ok(bindings) = bb { | 56 if let Ok(bindings) = bb { |