Mercurial > crates > nonstick
diff src/libpam/answer.rs @ 101:94b51fa4f797
Fix memory soundness issues:
- Ensure Questions are pinned in memory when sending them through PAM.
- Hold on to the PAM conversation struct after we build it.
(Linux-PAM is leninent about this and copies the pam_conv structure.)
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 24 Jun 2025 17:54:33 -0400 |
parents | 3f11b8d30f63 |
children |
line wrap: on
line diff
--- a/src/libpam/answer.rs Tue Jun 24 17:08:01 2025 -0400 +++ b/src/libpam/answer.rs Tue Jun 24 17:54:33 2025 -0400 @@ -6,10 +6,10 @@ pub use crate::libpam::pam_ffi::Answer; use crate::{ErrorCode, Result}; use std::ffi::CStr; +use std::mem::ManuallyDrop; use std::ops::{Deref, DerefMut}; use std::ptr::NonNull; -use std::{iter, mem, ptr, slice}; -use std::mem::ManuallyDrop; +use std::{iter, ptr, slice}; /// The corridor via which the answer to Messages navigate through PAM. #[derive(Debug)]