comparison src/libpam/handle.rs @ 78:002adfb98c5c

Rename files, reorder structs, remove annoying BorrowedBinaryData type. This is basically a cleanup change. Also it adds tests. - Renames the files with Questions and Answers to question and answer. - Reorders the structs in those files to put the important ones first. - Removes the BorrowedBinaryData type. It was a bad idea all along. Instead, we just use (&[u8], u8). - Adds some tests because I just can't help myself.
author Paul Fisher <paul@pfish.zone>
date Sun, 08 Jun 2025 03:48:40 -0400
parents 351bdc13005e
children 5aa1a010f1e8
comparison
equal deleted inserted replaced
77:351bdc13005e 78:002adfb98c5c
52 }; 52 };
53 ErrorCode::result_from(ret) 53 ErrorCode::result_from(ret)
54 } 54 }
55 55
56 /// Gets the `PAM_CONV` item from the handle. 56 /// Gets the `PAM_CONV` item from the handle.
57 fn conversation_item(&mut self) -> Result<&mut LibPamConversation> { 57 fn conversation_item(&mut self) -> Result<&mut LibPamConversation<'_>> {
58 let output: *mut LibPamConversation = ptr::null_mut(); 58 let output: *mut LibPamConversation = ptr::null_mut();
59 let result = unsafe { 59 let result = unsafe {
60 super::pam_get_item( 60 super::pam_get_item(
61 self, 61 self,
62 ItemType::Conversation.into(), 62 ItemType::Conversation.into(),