Mercurial > crates > nonstick
diff src/libpam/answer.rs @ 100:3f11b8d30f63
Implement environment variable management.
This actually wires up the environment variable handling to libpam,
so that applications and modules can manage the environment through
the authentication process.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Tue, 24 Jun 2025 17:08:01 -0400 |
parents | b87100c5eed4 |
children | 94b51fa4f797 |
line wrap: on
line diff
--- a/src/libpam/answer.rs Tue Jun 24 14:54:47 2025 -0400 +++ b/src/libpam/answer.rs Tue Jun 24 17:08:01 2025 -0400 @@ -9,6 +9,7 @@ use std::ops::{Deref, DerefMut}; use std::ptr::NonNull; use std::{iter, mem, ptr, slice}; +use std::mem::ManuallyDrop; /// The corridor via which the answer to Messages navigate through PAM. #[derive(Debug)] @@ -48,9 +49,7 @@ /// This object is consumed and the `Answer` pointer now owns its data. /// It can be recreated with [`Self::from_c_heap`]. pub fn into_ptr(self) -> NonNull<Answer> { - let ret = self.base; - mem::forget(self); - ret + ManuallyDrop::new(self).base } /// Takes ownership of a list of answers allocated on the C heap.