all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox] auth-api: log `authenticate` result not the return value of `start`
@ 2025-08-05 15:48 Shannon Sterz
  2025-08-05 16:40 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Shannon Sterz @ 2025-08-05 15:48 UTC (permalink / raw)
  To: pbs-devel

log the actual result of the `authenticate` call in order to make
debugging authentication issues easier. previously we logged the
result of the above `pam_sys::wrapped::start` call, which was
typically `SUCCESS` leading to the very confusing error message:

authentication error - SUCCESS (0)

when in reality the authentication failed.

note that pam uses the SUCCESS return code differently depending on
the function that is called. `pam_start` uses it to communicate that a
transaction was successfully started. `pam_authenticate` uses it to
communicate that a user was successfully logged in.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 proxmox-auth-api/src/pam_authenticator.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-auth-api/src/pam_authenticator.rs b/proxmox-auth-api/src/pam_authenticator.rs
index d34575be..ed8708da 100644
--- a/proxmox-auth-api/src/pam_authenticator.rs
+++ b/proxmox-auth-api/src/pam_authenticator.rs
@@ -64,7 +64,7 @@ impl crate::api::Authenticator for Pam {
             handle.result =
                 pam_sys::wrapped::authenticate(handle.handle, pam_sys::types::PamFlag::NONE);
             if handle.result != PamReturnCode::SUCCESS {
-                bail!("authentication error - {err}");
+                bail!("authentication error - {}", handle.result);
             }
 
             Ok(())
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] applied: [PATCH proxmox] auth-api: log `authenticate` result not the return value of `start`
  2025-08-05 15:48 [pbs-devel] [PATCH proxmox] auth-api: log `authenticate` result not the return value of `start` Shannon Sterz
@ 2025-08-05 16:40 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-08-05 16:40 UTC (permalink / raw)
  To: pbs-devel, Shannon Sterz

On Tue, 05 Aug 2025 17:48:20 +0200, Shannon Sterz wrote:
> log the actual result of the `authenticate` call in order to make
> debugging authentication issues easier. previously we logged the
> result of the above `pam_sys::wrapped::start` call, which was
> typically `SUCCESS` leading to the very confusing error message:
> 
> authentication error - SUCCESS (0)
> 
> [...]

Applied, thanks!

[1/1] auth-api: log `authenticate` result not the return value of `start`
      commit: ce56b76a8cf12e6b87035058f223de4f7bad391a


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-05 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-05 15:48 [pbs-devel] [PATCH proxmox] auth-api: log `authenticate` result not the return value of `start` Shannon Sterz
2025-08-05 16:40 ` [pbs-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal