From 9377ca3ef4b274df9b25cc56f38d69e70a61985c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 13 Feb 2024 16:57:01 +0100 Subject: Accept authz id == auth id --- src/auth.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auth.rs b/src/auth.rs index d5cc5ac..064c90c 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -202,11 +202,12 @@ enum State { const SERVER_MAJOR: u64 = 1; const SERVER_MINOR: u64 = 2; +const EMPTY_AUTHZ: &[u8] = &[]; impl State { async fn try_auth_plain<'a>(&self, data: &'a [u8], login: &ArcLoginProvider) -> AuthRes { // Check that we can extract user's login+pass let (ubin, pbin) = match auth_plain(&data) { - Ok(([], ([], user, pass))) => (user, pass), + Ok(([], (authz, user, pass))) if authz == user || authz == EMPTY_AUTHZ => (user, pass), Ok(_) => { tracing::error!("Impersonating user is not supported"); return AuthRes::Failed(None, None); -- cgit v1.2.3