Mercurial > crates > nonstick
diff src/libpam/pam_ffi.rs @ 113:178310336596
Fix up more constants, make things i32 rather than u32.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sun, 29 Jun 2025 03:11:33 -0400 |
parents | e97534be35e3 |
children |
line wrap: on
line diff
--- a/src/libpam/pam_ffi.rs Sun Jun 29 02:21:26 2025 -0400 +++ b/src/libpam/pam_ffi.rs Sun Jun 29 03:11:33 2025 -0400 @@ -3,7 +3,7 @@ #![allow(non_camel_case_types, non_upper_case_globals)] use crate::libpam::memory::{CHeapBox, Immovable}; -use std::ffi::{c_int, c_uint, c_void, CStr}; +use std::ffi::{c_int, c_void, CStr}; use std::marker::PhantomData; use std::ptr; @@ -51,7 +51,7 @@ #[derive(Debug)] pub struct Question { /// The style of message to request. - pub style: c_uint, + pub style: c_int, /// A description of the data requested. /// /// For most requests, this will be an owned [`CStr`], @@ -92,9 +92,9 @@ } /// Gets a string version of an error message. -pub fn strerror(code: c_uint) -> Option<&'static str> { +pub fn strerror(code: c_int) -> Option<&'static str> { // SAFETY: Every single PAM implementation I can find (Linux-PAM, OpenPAM, - // Solaris, etc.) returns a static string and ignores the handle value. + // Sun, etc.) returns a static string and ignores the handle value. let strerror = unsafe { pam_strerror(ptr::null_mut(), code as c_int) }; if strerror.is_null() { None