[pgpool-committers: 866] pgpool: Fix pool_has_pgpool_regclass() to check execute privilege of pg

Tatsuo Ishii ishii at postgresql.org
Sun Apr 7 12:33:03 JST 2013


Fix pool_has_pgpool_regclass() to check execute privilege of pgpool_regclass().

Bug track #53 shows that if pgpool cannot execute pgpool_regclass(),
the connection to backend hangs. You can reproduce the problem by just
dropping the execute privilege from pgpool_regclass and do some insert
in native replication mode:

2013-04-07 11:47:54 LOG:   pid 11799: DB node id: 0 backend pid: 11918 statement: SELECT count(*) FROM pg_catalog.pg_p
2013-04-07 11:47:54 LOG:   pid 11799: DB node id: 0 backend pid: 11918 statement: SELECT count(*) FROM pg_catalog.pg_a
2013-04-07 11:47:54 ERROR: pid 11799: do_query: error message from backend: permission denied for function pgpool_regc
2013-04-07 11:47:54 ERROR: pid 11799: pool_search_relcache: do_query failed
2013-04-07 11:47:54 LOG:   pid 11799: DB node id: 0 backend pid: 11918 statement: SELECT attname, d.adsrc, coalesce((d

To fix the problem, use has_function_privilege() for the query and
passes username to pool_search_relcache() instead of
"pgpool_regclass"(this is just a fake parameter) as the search
key.

Branch
------
V3_0_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=6d7b408d336460a314d858fe1146631b2af4af91

Modified Files
--------------
pool_select_walker.c |   11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)



More information about the pgpool-committers mailing list