Fix authentication failure after updating pool_passwd and reload.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 13 Nov 2024 06:28:06 +0000 (15:28 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 13 Nov 2024 06:45:22 +0000 (15:45 +0900)
If pool_hba.conf is disabled, updating pool_passwd was not recognized
by pgpool child process even if pgpool reload was performed.  The
reload processing function check_config_reload() mistakenly assumed
that reopening pool_passwd was only necessary when enable_pool_hba is
on.

Backpatch-through: v4.1
Discussion: https://www.pgpool.net/pipermail/pgpool-general/2024-November/001944.html

src/protocol/child.c

index 1d7df0f5326cf829518f8ffc8e226929218166c3..e9bbbfcfbbfda49a6de94aaded685dc373e1f2e1 100644 (file)
@@ -2141,9 +2141,10 @@ check_config_reload(void)
                if (pool_config->enable_pool_hba)
                {
                        load_hba(get_hba_file_name());
-                       if (strcmp("", pool_config->pool_passwd))
-                               pool_reopen_passwd_file();
                }
+               if (strcmp("", pool_config->pool_passwd))
+                       pool_reopen_passwd_file();
+
                got_sighup = 0;
        }
 }