From 91b88ad4dc255474ec6777734dc9dc5aa468a8f6 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Fri, 5 Apr 2019 16:53:51 +0900 Subject: [PATCH] Fix md5 auth broken in raw mode. In raw mode, pool_passwd is not necessary to authenticate PostgreSQL using md5 auth. However if there's more than 1 backend, authenticating with md5 fails. Fix is, checking whether we are operating in raw mode while do md5 authentication. This was broken in 4.0, so back-patched to only 4.0. Per bug 491. --- src/auth/pool_auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth/pool_auth.c b/src/auth/pool_auth.c index 1f108fb77..78316b819 100644 --- a/src/auth/pool_auth.c +++ b/src/auth/pool_auth.c @@ -484,7 +484,7 @@ pool_do_auth(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * cp) /* * check if we can use md5 authentication. */ - if (NUM_BACKENDS > 1) + if (!RAW_MODE && NUM_BACKENDS > 1) { if (get_auth_password(MASTER(cp), frontend, 0, &password, &passwordType) == false) @@ -1705,7 +1705,7 @@ do_md5(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int pr char encbuf[POOL_PASSWD_LEN + 1]; char *pool_passwd = NULL; - if (NUM_BACKENDS == 1) + if (RAW_MODE || NUM_BACKENDS == 1) return do_md5_single_backend(backend, frontend, reauth, protoMajor); if (passwordType == PASSWORD_TYPE_AES) -- 2.39.5