comparison build.rs @ 92:5ddbcada30f2

Add the ability to log against a PAM handle. PAM impls provide a way to log to syslog. This exposes it via nonstick.
author Paul Fisher <paul@pfish.zone>
date Sun, 22 Jun 2025 19:29:32 -0400
parents f6186e41399b
children efe2f5f8b5b2
comparison
equal deleted inserted replaced
91:039aae9a01f7 92:5ddbcada30f2
21 .default_macro_constant_type(MacroTypeVariation::Unsigned); 21 .default_macro_constant_type(MacroTypeVariation::Unsigned);
22 22
23 let linux_builder = common_builder 23 let linux_builder = common_builder
24 .clone() 24 .clone()
25 // This function is not available in OpenPAM. 25 // This function is not available in OpenPAM.
26 // We don't use it, but we include it so that if the user 26 // That means if somebody tries to run a binary compiled for
27 // tries to run this against the wrong PAM library, it fails. 27 // Linux-PAM against a different impl, it will fail.
28 .allowlist_function("pam_start_confdir") 28 .allowlist_function("pam_syslog")
29 .header_contents( 29 .header_contents(
30 "linux-pam.h", 30 "linux-pam.h",
31 r#" 31 r#"
32 #include <syslog.h> // for log levels
32 #include <security/_pam_types.h> 33 #include <security/_pam_types.h>
33 #include <security/pam_appl.h> 34 #include <security/pam_appl.h>
34 #include <security/pam_ext.h> 35 #include <security/pam_ext.h>
35 #include <security/pam_modules.h> 36 #include <security/pam_modules.h>
36 "#, 37 "#,
37 ); 38 );
38 let openpam_builder = common_builder 39 let openpam_builder = common_builder
39 .clone() 40 .clone()
40 // This function is not available in Linux-PAM. 41 // This function is not available in Linux-PAM.
41 // We don't use it, but we include it so that if the user 42 // That means if somebody tries to run a binary compiled for
42 // tries to run this against the wrong PAM library, it fails. 43 // OpenPAM against a different impl, it will fail.
43 .allowlist_function("pam_setenv") 44 .allowlist_function("openpam_log")
44 .header_contents( 45 .header_contents(
45 "openpam.h", 46 "openpam.h",
46 r#" 47 r#"
47 #include <security/pam_types.h> 48 #include <security/pam_types.h>
48 #include <security/openpam.h> 49 #include <security/openpam.h>