comparison src/libpam/memory.rs @ 80:5aa1a010f1e8

Start using PAM headers; improve owned/borrowed distinction. - Uses bindgen to generate bindings (only if needed). - Gets the story together on owned vs. borrowed handles. - Reduces number of mutable borrows in handle operation (since `PamHandle` is neither `Send` nor `Sync`, we never have to worry about thread safety. - Improves a bunch of macros so we don't have our own special syntax for docs. - Implement question indirection for standard XSSO PAM implementations.
author Paul Fisher <paul@pfish.zone>
date Tue, 10 Jun 2025 01:09:30 -0400
parents 2128123b9406
children
comparison
equal deleted inserted replaced
79:2128123b9406 80:5aa1a010f1e8
23 libc::free(p.cast()) 23 libc::free(p.cast())
24 } 24 }
25 25
26 /// Makes whatever it's in not [`Send`], [`Sync`], or [`Unpin`]. 26 /// Makes whatever it's in not [`Send`], [`Sync`], or [`Unpin`].
27 #[repr(C)] 27 #[repr(C)]
28 #[derive(Debug)] 28 #[derive(Debug, Default)]
29 pub struct Immovable(pub PhantomData<(*mut u8, PhantomPinned)>); 29 pub struct Immovable(pub PhantomData<(*mut u8, PhantomPinned)>);
30 30
31 /// Safely converts a `&str` option to a `CString` option. 31 /// Safely converts a `&str` option to a `CString` option.
32 pub fn option_cstr(prompt: Option<&str>) -> Result<Option<CString>> { 32 pub fn option_cstr(prompt: Option<&str>) -> Result<Option<CString>> {
33 prompt 33 prompt