diff libpam-sys/src/structs.rs @ 119:476a22db8639

Add PtrPtrVec to make it easy to pass pointer-to-pointers to PAM.
author Paul Fisher <paul@pfish.zone>
date Mon, 30 Jun 2025 01:40:28 -0400
parents 39760dfc9b3b
children
line wrap: on
line diff
--- a/libpam-sys/src/structs.rs	Sun Jun 29 20:13:03 2025 -0400
+++ b/libpam-sys/src/structs.rs	Mon Jun 30 01:40:28 2025 -0400
@@ -44,7 +44,12 @@
 /// see the [`helpers`](crate::helpers) module.
 pub type ConversationCallback = unsafe extern "C" fn(
     num_msg: c_int,
+    // This is a *const *const because accessing memory from a reference
+    // outside its bounds is undefined behavior, and *messages is an array
+    // in X/SSO PAM impls.
     messages: *const *const Message,
+    // This is a &mut *mut because the caller sets the pointer in `responses`
+    // but does not mess around outside its memory space.
     responses: &mut *mut Response,
     appdata: *const AppData,
 ) -> c_int;