Fix Rust 2024 unsafe block warnings in PAM callback
Wrap raw pointer operations in explicit unsafe blocks inside the unsafe extern "C" conv callback, as required by Rust 2024 edition. Remove unused mut binding.
This commit is contained in:
parent
817a9547ad
commit
60e63a6857
@ -64,6 +64,7 @@ unsafe extern "C" fn pam_conv_callback(
|
|||||||
resp: *mut *mut PamResponse,
|
resp: *mut *mut PamResponse,
|
||||||
appdata_ptr: *mut libc::c_void,
|
appdata_ptr: *mut libc::c_void,
|
||||||
) -> libc::c_int {
|
) -> libc::c_int {
|
||||||
|
unsafe {
|
||||||
// Safety: appdata_ptr was set to a valid *const CString in authenticate()
|
// Safety: appdata_ptr was set to a valid *const CString in authenticate()
|
||||||
let password = appdata_ptr as *const CString;
|
let password = appdata_ptr as *const CString;
|
||||||
if password.is_null() {
|
if password.is_null() {
|
||||||
@ -92,6 +93,7 @@ unsafe extern "C" fn pam_conv_callback(
|
|||||||
// Safety: resp is a valid pointer provided by PAM
|
// Safety: resp is a valid pointer provided by PAM
|
||||||
*resp = resp_array;
|
*resp = resp_array;
|
||||||
PAM_SUCCESS
|
PAM_SUCCESS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Authenticate a user via PAM.
|
/// Authenticate a user via PAM.
|
||||||
|
|||||||
@ -47,7 +47,7 @@ pub fn create_lockscreen_window(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut fp_listener = FingerprintListener::new();
|
let fp_listener = FingerprintListener::new();
|
||||||
let fp_available = config.fingerprint_enabled
|
let fp_available = config.fingerprint_enabled
|
||||||
&& fp_listener.is_available(&user.username);
|
&& fp_listener.is_available(&user.username);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user