From 6e74c6c1dce25d1872831eb83dbdc5a1d6e80e06 Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Thu, 12 Jul 2018 13:14:10 +0200 Subject: [PATCH] auth: Improve pending call error messages This can help when debugging in the future Signed-off-by: Anderson Toshiyuki Sasaki Reviewed-by: Andreas Schneider --- src/auth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/auth.c b/src/auth.c index da746822..d112e2f7 100644 --- a/src/auth.c +++ b/src/auth.c @@ -355,7 +355,8 @@ int ssh_userauth_none(ssh_session session, const char *username) { goto pending; default: ssh_set_error(session, SSH_FATAL, - "Wrong state during pending SSH call"); + "Wrong state (%d) during pending SSH call", + session->pending_call_state); return SSH_AUTH_ERROR; } @@ -450,7 +451,8 @@ int ssh_userauth_try_publickey(ssh_session session, default: ssh_set_error(session, SSH_FATAL, - "Wrong state during pending SSH call"); + "Wrong state (%d) during pending SSH call", + session->pending_call_state); return SSH_ERROR; } @@ -1119,7 +1121,8 @@ int ssh_userauth_password(ssh_session session, default: ssh_set_error(session, SSH_FATAL, - "Wrong state during pending SSH call"); + "Wrong state (%d) during pending SSH call", + session->pending_call_state); return SSH_ERROR; } @@ -1763,7 +1766,8 @@ int ssh_userauth_gssapi(ssh_session session) { default: ssh_set_error(session, SSH_FATAL, - "Wrong state during pending SSH call"); + "Wrong state (%d) during pending SSH call", + session->pending_call_state); return SSH_ERROR; }