diff src/libpam/items.rs @ 163:a75a66cb4181

Add end-to-end tests; fix issues found by tests. - Create tests and installer/remover shell script - Fix Pointer/pointee problems - Add Debug formatting - Misc cleanup
author Paul Fisher <paul@pfish.zone>
date Mon, 14 Jul 2025 17:40:11 -0400
parents 1bc52025156b
children a1bb1d013567
line wrap: on
line diff
--- a/src/libpam/items.rs	Mon Jul 14 15:07:16 2025 -0400
+++ b/src/libpam/items.rs	Mon Jul 14 17:40:11 2025 -0400
@@ -58,12 +58,9 @@
 /// # Safety
 ///
 /// You better be requesting an item which is a C string.
-pub unsafe fn get_cstr_item(
-    hdl: &LibPamHandle,
-    item_type: ItemType,
-) -> crate::Result<Option<OsString>> {
+pub unsafe fn get_cstr_item(hdl: &LibPamHandle, item_type: ItemType) -> Result<Option<OsString>> {
     let mut output = ptr::null();
-    let ret = unsafe { libpam_sys::pam_get_item(hdl.raw_ref(), item_type as c_int, &mut output) };
+    let ret = unsafe { libpam_sys::pam_get_item(hdl.inner(), item_type as c_int, &mut output) };
     ErrorCode::result_from(ret)?;
     Ok(memory::copy_pam_string(output.cast()))
 }
@@ -77,11 +74,11 @@
     hdl: &mut LibPamHandle,
     item_type: ItemType,
     data: Option<&OsStr>,
-) -> crate::Result<()> {
+) -> Result<()> {
     let data_str = memory::option_cstr_os(data);
     let ret = unsafe {
         libpam_sys::pam_set_item(
-            hdl.raw_mut(),
+            hdl.inner_mut(),
             item_type as c_int,
             memory::prompt_ptr(data_str.as_deref()).cast(),
         )