diff src/conv.rs @ 51:9d1160b02d2c

Safety and doc fixes: - Don't panic when given a string with a null character; instead return `PAM_CONV_ERR`. - Improve pattern matching and use ?s where appropriate. - Format etc.
author Paul Fisher <paul@pfish.zone>
date Sat, 03 May 2025 18:41:25 -0400
parents a921b72743e4
children
line wrap: on
line diff
--- a/src/conv.rs	Wed Apr 16 16:55:59 2025 -0400
+++ b/src/conv.rs	Sat May 03 18:41:25 2025 -0400
@@ -19,11 +19,6 @@
     resp_retcode: libc::c_int, // Unused - always zero
 }
 
-/// `PamConv` acts as a channel for communicating with user.
-///
-/// Communication is mediated by the pam client (the application that invoked
-/// pam).  Messages sent will be relayed to the user by the client, and response
-/// will be relayed back.
 #[repr(C)]
 pub struct Inner {
     conv: extern "C" fn(
@@ -35,6 +30,11 @@
     appdata_ptr: *const libc::c_void,
 }
 
+/// A `Conv`ersation channel with the user.
+///
+/// Communication is mediated by the PAM client (the application that invoked
+/// pam).  Messages sent will be relayed to the user by the client, and response
+/// will be relayed back.
 pub struct Conv<'a>(&'a Inner);
 
 impl Conv<'_> {