/// Lock-mode auth: verify the current user's credential via PAM (`unix_chkpwd`).
/// Blocks; run on a worker thread.
pub fn verify( user: &str, password: &str ) -> Result<(), String>
{
	match pam::Authenticator::with_password( "login" )
	{
		Ok( mut auth ) =>
		{
			auth.get_handler().set_credentials( user, password );
			auth.authenticate().map_err( |e| format!( "{e:?}" ) )
		}
		Err( e ) => Err( format!( "{e:?}" ) ),
	}
}
