diff src/constants.rs @ 85:5e14bb093851

fix more openpam compat stuff
author Paul Fisher <paul@pfish.zone>
date Tue, 10 Jun 2025 02:42:29 -0400
parents a638a45e5f1f
children 23162cd399aa
line wrap: on
line diff
--- a/src/constants.rs	Tue Jun 10 02:35:11 2025 -0400
+++ b/src/constants.rs	Tue Jun 10 02:42:29 2025 -0400
@@ -14,7 +14,7 @@
 /// any PAM implementations. Applications should always use the symbolic value
 /// and not a magic number.**
 #[cfg(not(feature = "link"))]
-mod ffi {
+mod pam_ffi {
     macro_rules! define {
         ($(#[$attr:meta])* $($name:ident = $value:expr),+) => {
             define!(
@@ -84,24 +84,24 @@
     #[repr(transparent)]
     pub struct Flags: c_uint {
         /// The module should not generate any messages.
-        const SILENT = pam_ffi::PAM_SILENT;
+        const SILENT = pam_ffi::PAM_SILENT as u32;
 
         /// The module should return [ErrorCode::AuthError]
         /// if the user has an empty authentication token
         /// rather than immediately accepting them.
-        const DISALLOW_NULL_AUTHTOK = pam_ffi::PAM_DISALLOW_NULL_AUTHTOK;
+        const DISALLOW_NULL_AUTHTOK = pam_ffi::PAM_DISALLOW_NULL_AUTHTOK as u32;
 
         // Flag used for `set_credentials`.
 
         /// Set user credentials for an authentication service.
-        const ESTABLISH_CREDENTIALS = pam_ffi::PAM_ESTABLISH_CRED;
+        const ESTABLISH_CREDENTIALS = pam_ffi::PAM_ESTABLISH_CRED as u32;
         /// Delete user credentials associated with
         /// an authentication service.
-        const DELETE_CREDENTIALS = pam_ffi::PAM_DELETE_CRED;
+        const DELETE_CREDENTIALS = pam_ffi::PAM_DELETE_CRED as u32;
         /// Reinitialize user credentials.
-        const REINITIALIZE_CREDENTIALS = pam_ffi::PAM_REINITIALIZE_CRED;
+        const REINITIALIZE_CREDENTIALS = pam_ffi::PAM_REINITIALIZE_CRED as u32;
         /// Extend the lifetime of user credentials.
-        const REFRESH_CREDENTIALS = pam_ffi::PAM_REFRESH_CRED;
+        const REFRESH_CREDENTIALS = pam_ffi::PAM_REFRESH_CRED as u32;
 
         // Flags used for password changing.