View Issue Details

IDProjectCategoryView StatusLast Update
0000491Pgpool-IIBugpublic2019-04-09 14:33
ReportereldarsuddenAssigned Tot-ishii 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionopen 
PlatformOSLinuxOS VersionCentOS 7.5
Product Version4.0.3 
Target Version4.0.5Fixed in Version 
Summary0000491: MD5 Authentication doesn't work as expected in RAW mode with more than 1 backends
Description"If Pgpool-II is operated in raw mode or there's only 1 backend configured, you don't need to setup pool_passwd." declarated here: http://www.pgpool.net/docs/latest/en/html/auth-methods.html#AUTH-MD5
We are using pgpool in our environment with following parameters:

enable_pool_hba = off
pool_passwd = ''

replication_mode = off
master_slave_mode = off
load_balance_mode = off

With RAW mode (more than 1 backends) we are getting the following errors:
"ERROR: unable to get password, password file descriptor is NULL".
It works as expected when there's only 1 backend. I've made a patch for this and now seems perfectly fine.
Additional Informationdiff --git a/src/auth/pool_auth.c b/src/auth/pool_auth.c
index 1f108fb..78316b8 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)
TagsNo tags attached.

Activities

t-ishii

2019-04-04 21:25

developer   ~0002522

Thank you for the report and patches. I will look into them.

t-ishii

2019-04-05 16:53

developer   ~0002524

I confirmed that your patch definitely fixes the problem. Pgpool-II has been bugged by this since 4.0. So I am going to commit/push the patch to 4.0 stable and master tree. Thank you again!

t-ishii

2019-04-09 14:33

developer   ~0002538

Fix committed/pushed as:
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=91b88ad4dc255474ec6777734dc9dc5aa468a8f6

Issue History

Date Modified Username Field Change
2019-04-04 12:54 eldarsudden New Issue
2019-04-04 17:59 administrator Assigned To => t-ishii
2019-04-04 17:59 administrator Status new => assigned
2019-04-04 21:25 t-ishii Note Added: 0002522
2019-04-05 16:53 t-ishii Note Added: 0002524
2019-04-05 17:00 t-ishii Status assigned => feedback
2019-04-05 17:00 t-ishii Target Version => 4.0.5
2019-04-09 14:33 t-ishii Note Added: 0002538
2019-04-09 14:33 t-ishii Status feedback => resolved