Takuma Hoshiai [Thu, 15 Nov 2018 04:49:41 +0000 (13:49 +0900)]
Add missed src/tools/pgenc/pg_enc.c by commit
bc9119f61b187577d64b63ebffb6f5412202f24f.
Tatsuo Ishii [Thu, 15 Nov 2018 00:21:30 +0000 (09:21 +0900)]
Fix memory leak found by Coverity,
This is actually harmless since in the situation pgpool child process
exits and the leaked memory is gone anyway. I just want to shut off
Coverity's complain.
Takuma Hoshiai [Tue, 13 Nov 2018 06:54:57 +0000 (15:54 +0900)]
Fix compiler warnings with gcc 8.x.
Bo Peng [Tue, 13 Nov 2018 01:50:50 +0000 (10:50 +0900)]
Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
If the number of parameter format codes is specified to one, but the number of the original query's
parameter is zero, bind_rewrite_timestamp() will call memcpy with a negative value for size_t.
This causes segmentation fault.
Patch is provided by Yugo Nagata.
Per bug 443.
Tatsuo Ishii [Thu, 8 Nov 2018 05:37:18 +0000 (14:37 +0900)]
Fix a query passed to relcache so that it uses schema qualified table name.
This should have been done for all similar queries to follow PostgreSQL's schema usage pattern.
However there was one missed at that time.
Bo Peng [Thu, 8 Nov 2018 06:02:10 +0000 (15:02 +0900)]
Start 4.1 development.
- Set version string to "4.1devel".
- Set new code name "karasukiboshi".
Tatsuo Ishii [Mon, 5 Nov 2018 12:14:58 +0000 (21:14 +0900)]
Fix query cache invalidation bug.
When a DML is executed in an explicit transaction, the table oid
buffer is wiped out by pool_reset_memqcache_buffer() and query cache
is not invalidated at the commit time because there's no DML oid
exists to invalidate query cache any more. To fix this, add new bool
parameter to pool_reset_memqcache_buffer() to specify whether to reset
table oid buffer or not. When a DML is executed in an explicit
transaction, call pool_reset_memqcache_buffer(false) to preserve the
table oid buffer.
Issue reported at https://github.com/pgpool/pgpool2/issues/19.
Tatsuo Ishii [Sat, 3 Nov 2018 13:07:31 +0000 (22:07 +0900)]
Fix segfault in extended query + query cache case.
If extended query is used when query cache enabled, Pgpool-II could
crash in certain case.
- parse before bind fires.
- a bind message is sent with previously parsed named statement and
unnamed portal.
- an explicit transaction is used.
When parse before bind fires, a new sent message corresponding to the
re-parsed message was not created.
When a bind message is sent from frontend using previously parsed
message and unnamed portal, Pgpool-II tries to add the unnamed portal
to the sent message list by calling
pool_add_sent_message(). pool_add_sent_message() removes the old
unnamed portal and add the new unnamed portal. Also it tries to remove
corresponding query context if it's not used by 2 or more sent
messages. Usually a query context is used by a named statement and an
unnamed portal and the query context will not moved.
However because when parse before bind fires a new sent message
corresponding to the re-parsed message was not created, the reference
count is 1, which cause the query context gets removed.
When the transaction ends, temporary buffer for query cache needed to
be removed. Unfortunately since the pointer to the temporary buffer
for query cache is stored in the query context which was just removed,
the pointer to the buffer points to a random address, and segfault
occurs.
Because of the the reason if query cache is not enabled, the segfalt
does not occurs.
Note that this bug is easily reproduced by using "pgbench -M
prepared". ("pgbench -M extended" does not trigger the bug because it
does not use named statements.)
Fix is, When parse before bind fires, add a new sent message
corresponding to the re-parsed message.
Tatsuo Ishii [Thu, 1 Nov 2018 00:22:46 +0000 (09:22 +0900)]
Fix memory leak in extended query + query cache enabled.
If a bind message is sent again to an existing prepared statement, it
is possible that the previously allocated bind parameter string
remains and newly allocated bind parameter string's pointer is set to
there, which leads to a memory leak.
Note that if a statement is parsed again in usual way, the parameter
string will be freed along with the old query context. So the leak
does not happen.
I suspect the use case for the memory leak (bind, execute is repeated
against a same prepared statement) is actually rare in the
field. Probably that's why the problem has not been reported until
today although the leak had existed since day 0.
The leak case can be easily reproduced by "pgbench -M prepared" by the
way.
Bo Peng [Wed, 31 Oct 2018 02:02:02 +0000 (11:02 +0900)]
doc: fix typo in previous commit.
Bo Peng [Wed, 31 Oct 2018 01:54:16 +0000 (10:54 +0900)]
doc: change to release notes.
Bo Peng [Wed, 31 Oct 2018 01:11:46 +0000 (10:11 +0900)]
doc: change release notes.
Muhammad Usama [Tue, 30 Oct 2018 13:08:52 +0000 (18:08 +0500)]
Fix for
0000419: pg_md5: -m removes users
The problem was in pool_create_passwdent() which was expecting the password
string will always have the same length. This is not true anymore after the
support for AES and TEXT type passwords, So inlace updating of pool_passwd is
not an option anymore.
The fix is to use the memory buffer to compile the pool_passwd file and rewrite
it completely.
The patch was provided by Takuma Hoshiai <hoshiai@sraoss.co.jp>
and modified by me.
Muhammad Usama [Tue, 30 Oct 2018 12:40:37 +0000 (17:40 +0500)]
Allow ssl key files to be owned by users other than us and root.
Pgpool-II inherited this from PostgreSQL, which imposes this restriction on
ssl key files for security reasons, but this doesn't makes much sense in case of
Pgpool-II because for many setups Pgpool-II would share the ssl certificates and
key files with PostgreSQL while running from a different OS user.
Muhammad Usama [Tue, 30 Oct 2018 11:35:10 +0000 (16:35 +0500)]
Allow PCP[attach/detach/promote] commands during failover.
We have made the Pgpool-II to handle the multiple failover/failback/promote
node requests by adding the request queue a long time ago. But somehow we were
still not accepting the pcp_[attach/detach/promote] requests during the failover.
This commit removes this unwanted restriction and allow queuing of node operation
requests from PCP client during the failover.
Bo Peng [Tue, 30 Oct 2018 01:32:37 +0000 (10:32 +0900)]
doc: Add release-note.
Tatsuo Ishii [Thu, 25 Oct 2018 10:58:34 +0000 (19:58 +0900)]
Fix typo in child_max_connections description.
Patch provided by Phil Ramirez.
Takuma Hoshiai [Mon, 22 Oct 2018 07:30:40 +0000 (16:30 +0900)]
Fix segmentation fault, when client send sync message in native replication mode.
When the query to be executed does not exist, if client sent 'Sync' messages to Pgpool-II which in native replication mode, occurred segmentation fault.
See:
https://www.pgpool.net/mantisbt/view.php?id=434
for more details.
Bo Peng [Fri, 19 Oct 2018 03:11:11 +0000 (12:11 +0900)]
Change pgpool.spec to not include pgpool_regclass from PostgreSQL 9.3.
Bo Peng [Fri, 19 Oct 2018 02:45:24 +0000 (11:45 +0900)]
Fix syntax error in SPEC file.
Bo Peng [Fri, 19 Oct 2018 02:33:49 +0000 (11:33 +0900)]
Some changes to SPEC file.
Bo Peng [Fri, 19 Oct 2018 01:01:58 +0000 (10:01 +0900)]
Some changes to SPEC file.
Bo Peng [Fri, 19 Oct 2018 00:53:25 +0000 (09:53 +0900)]
Some changes to release-note.
Bo Peng [Thu, 18 Oct 2018 09:12:24 +0000 (18:12 +0900)]
Fix syntax error in native replication, when queries including now() etc. and "IN (SELECT ...)" in WHERE clause.
In native replication, queries including now() etc. are rewritten to a timestamp constant value.
However, Pgpool-II didn't support queries including now() etc. and "IN (SELECT ...)" in WHERE clause.
Per bug433.
Bo Peng [Thu, 18 Oct 2018 09:05:47 +0000 (18:05 +0900)]
Fix docuemnt typos and update release date.
Bo Peng [Thu, 18 Oct 2018 08:51:13 +0000 (17:51 +0900)]
Change pgpool.spec file to install extension to server which supports LLVM JIT.
Tatsuo Ishii [Fri, 12 Oct 2018 04:52:57 +0000 (13:52 +0900)]
Fix occasional less data returned to frontend.
While piggy-packing queries to system catalog data,
pool_push_pending_data() is responsible for pushing response from
backend. To judge whether pending data remains or not, it checks
socket fd of backend and dummy close message response (close
complete). Problem is, if the socket is not ready and accidentally
actual (non dummy) close message response is returned,
pool_push_pending_data() believes that there's no pending data any
more. As a result, some of pending data is not recovered after
returning to normal process.
The idea for fix is, use pending message data list. It records
messages from frontend, and it is expected that we will receive same
number of messages (or more -- e.g. execute message). So we can use
the data to make above judgment more robust for the case described
above.
Initial patch is created by Yugo Nagata. Fix to the patch for certain
cases by me.
See:
https://www.pgpool.net/mantisbt/view.php?id=432
for more details.
Tatsuo Ishii [Thu, 11 Oct 2018 08:52:57 +0000 (17:52 +0900)]
Fix memory leak when query cache enabled in streaming replication mode + extended query case.
If BEGIN is executed in extended protocol, allocated temp buffer for
the command never discarded. This is because in streaming replication
mode + extended query case, when handle_query_cache gets called at the
command complete timing, the reference counter to query context is not
0, which in turn prevents from calling
pool_discard_temp_query_cache().
In reality, we don't need to care about the query context here, so
let's proceed in streaming replication mode + extended query case.
Note that the memory leak case can be easily reproduced by "pgbench -M
extended" command (standard TPC-B).
Tatsuo Ishii [Wed, 10 Oct 2018 04:05:39 +0000 (13:05 +0900)]
doc: add note to online recovery doc.
This warns that client_idle_limit_in_recovery must be smaller than
recovery_timeout.
Tatsuo Ishii [Tue, 9 Oct 2018 08:56:31 +0000 (17:56 +0900)]
Add "log_client_messages = on" to pursue occasional failure of 065 test.
Sometimes it fails with:
Exception in thread "main" org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
at org.postgresql.jdbc.PgResultSet.checkResultSet(PgResultSet.java:2789)
at org.postgresql.jdbc.PgResultSet.getString(PgResultSet.java:1887)
at Main.main(Main.java:26)
Tatsuo Ishii [Tue, 9 Oct 2018 08:37:25 +0000 (17:37 +0900)]
Fix memory leak pointed out by Coverity.
Tatsuo Ishii [Tue, 9 Oct 2018 04:49:49 +0000 (13:49 +0900)]
Fix memory leak in trigger_failover_command.
Pointed out by Coverity.
Tatsuo Ishii [Tue, 9 Oct 2018 01:47:24 +0000 (10:47 +0900)]
Allow to handle beta or rc version.
pgpool_setup failed to extract major version number if it includes non
numeric characters.
Bo Peng [Tue, 9 Oct 2018 00:20:39 +0000 (09:20 +0900)]
Fix memory leak when memory_cache_enabled = on and write SQLs are sent.
In a explicit transaction, we the SELECT results are cached in temporary buffer.
If a write SQL is sent which modifies the table, the temporary buffe should be reset.
Tatsuo Ishii [Mon, 8 Oct 2018 22:50:03 +0000 (07:50 +0900)]
Fix occasional failure in regression 065.bug152.
In the test first create a table with some data, then query
it. However sometimes it seems replication delay causes the table
still not ready in standby. Since there's no reason we need to a
standby or slave for this particular test, let the test have only
primary/master.
Tatsuo Ishii [Fri, 5 Oct 2018 22:17:16 +0000 (07:17 +0900)]
Fix comment broken by pgindent.
Tatsuo Ishii [Fri, 5 Oct 2018 22:12:50 +0000 (07:12 +0900)]
Revert "Fix comment broken by pgindent."
This reverts commit
228b20e43e7d719bb4acc5dc03e7c521f0099f3b.
Tatsuo Ishii [Fri, 5 Oct 2018 12:49:22 +0000 (21:49 +0900)]
Fix comment broken by pgindent.
Tatsuo Ishii [Fri, 5 Oct 2018 08:38:47 +0000 (17:38 +0900)]
Add "log_client_messages = on" to know more detailed info.
We see occasional failure of the test. To know what's going on, the
new parameter in 4.0 should help a lot.
Tatsuo Ishii [Fri, 5 Oct 2018 02:10:08 +0000 (11:10 +0900)]
Fix memory leak pointed out by 2018/10/5 Coverity scan.
While processing command complete message in extended query/streaming
replication mode, failure to read from socket leads to memory leak.
Tatsuo Ishii [Thu, 4 Oct 2018 22:56:57 +0000 (07:56 +0900)]
Fix some coverity warnings.
CommandComplete.c: fix memory leak
pool_memqcache.c: fix access to already freed data
Tatsuo Ishii [Thu, 4 Oct 2018 04:29:08 +0000 (13:29 +0900)]
Fix regression test 024 failure.
The generated SSL auth files, at least key files needed to be set
permissions to 600.
Bo Peng [Wed, 3 Oct 2018 02:46:54 +0000 (11:46 +0900)]
Fix document typo.
Tatsuo Ishii [Sat, 29 Sep 2018 13:13:05 +0000 (22:13 +0900)]
Try to fix regression test 024 failure.
It seems the valid period of root cert is default to now.
Set it to from now to 1 year after. See if this works.
Tatsuo Ishii [Fri, 28 Sep 2018 08:59:51 +0000 (17:59 +0900)]
Add cert authentication test.
Tatsuo Ishii [Mon, 24 Sep 2018 07:25:06 +0000 (16:25 +0900)]
Fix to add execution permission.
The regression 071 script lacked execution permission.
Bo Peng [Fri, 21 Sep 2018 08:32:30 +0000 (17:32 +0900)]
Add EXECUTE/DEALLOCATE regression test.
Patch created by Takuma Hoshiai.
Bo Peng [Wed, 19 Sep 2018 06:06:50 +0000 (15:06 +0900)]
Enable AM_MAINTAINER_MODE for master branch.
Bo Peng [Wed, 19 Sep 2018 04:10:40 +0000 (13:10 +0900)]
Update pgpool.spec.
Bo Peng [Wed, 19 Sep 2018 03:57:46 +0000 (12:57 +0900)]
Fix typos.
Bo Peng [Wed, 19 Sep 2018 03:50:38 +0000 (12:50 +0900)]
Change Makefile of pgpool_recovery.
Bo Peng [Wed, 19 Sep 2018 03:31:17 +0000 (12:31 +0900)]
Prepare 4.0beta1.
Bo Peng [Wed, 19 Sep 2018 03:09:26 +0000 (12:09 +0900)]
Update pgpool.spec file.
Bo Peng [Wed, 19 Sep 2018 03:07:49 +0000 (12:07 +0900)]
Some changes to 4.0 release-note and update release-note version.
Takuma Hoshiai [Wed, 19 Sep 2018 00:57:51 +0000 (09:57 +0900)]
Doc: Add Japanese release-note for Pgpool-II 4.0, and change some documents about authentication.
Bo Peng [Wed, 19 Sep 2018 00:39:04 +0000 (09:39 +0900)]
Disable AM_MAINTAINER_MODE.
Bo Peng [Wed, 19 Sep 2018 00:25:31 +0000 (09:25 +0900)]
Add missing pgpool_recovery--1.0--1.1.sql file to update pgpool_recovery() function version to 1.1.
Bo Peng [Tue, 18 Sep 2018 03:27:45 +0000 (12:27 +0900)]
Add pgpool_recovery--1.1--1.2.sql file to update pgpool_recovery() function version.
Bo Peng [Thu, 13 Sep 2018 08:30:58 +0000 (17:30 +0900)]
Fix kind mismatch error when DEALLOCATE statement is issued.
PREPARE should be add to pool_add_sent_message, so that EXECUTE and DEALLOCATE
can be sent to the same node as PREPARE.
See [pgpool-general: 6226] for more details.
Tatsuo Ishii [Thu, 13 Sep 2018 06:02:03 +0000 (15:02 +0900)]
Downgrade warning to debug5 when AES/PLAIN password not found in pool_passwd.
When health_check_password etc. is an empty string, Pgpool-II tries to
fetch AES/PLAIN password in pool_passwd. If other type of password
entry (actually it must be MD5), it warned it. However this is normal
setting till 3.7. Moreover, every time health check or streaming
replication delay check run, it emits the waring and the log file was
filled up with the message.
Solution is, downgrade the message to DEBUG5. Also add password type to
the message.
Bo Peng [Mon, 10 Sep 2018 02:56:18 +0000 (11:56 +0900)]
Add missing src/parser/scan.c file.
Tatsuo Ishii [Mon, 10 Sep 2018 02:06:15 +0000 (11:06 +0900)]
Fix buildfarm error of 023.ssl_connection.
It seems CentOS6/7 recognizes "localhost" as IPv6 ::1.
2018-09-08 17:04:06: pid 21508: DETAIL: no pg_hba.conf entry for host "::1", user "postgres", database "postgres", SSL on
So add following line to pg_hba.conf.
host all all ::1/128 trust
Let's see if buildfarm still complains.
Bo Peng [Thu, 6 Sep 2018 09:00:49 +0000 (18:00 +0900)]
Prepare 4.0alpha2.
Bo Peng [Thu, 6 Sep 2018 08:57:32 +0000 (17:57 +0900)]
Add some changes to 4.0 english release note.
Bo Peng [Thu, 6 Sep 2018 08:12:37 +0000 (17:12 +0900)]
Add japanese docs for changes about client authentication, and fix some doc typos.
Patch provided by Takuma Hoshiai.
Muhammad Usama [Wed, 5 Sep 2018 06:55:00 +0000 (11:55 +0500)]
Fix for
0000428: Secure TCP/IP Connections with SSL...
check for empty string in pool_config->ssl_ca_cert before
trying to load root certificates
Bo Peng [Wed, 5 Sep 2018 05:19:57 +0000 (14:19 +0900)]
Add "Migration to Version 4.0" section to releasenote.
Muhammad Usama [Tue, 4 Sep 2018 16:01:26 +0000 (21:01 +0500)]
Miscellaneous fixes in the area of SCRAM authentication.
The commit takes care of resource leak warnings reported by coverity
in the authentication module of Pgpool-II, Apart from doing the individual
resource leak fixes I have made the authentication system to use the temporary
memory context which gets deleted after the authentication is done.
In addition to the memory related fixes the commit also contains the following.
-- TEXT prefix support for specifying plain text passwords in configuration
and pool_passwd file.
-- Documentation updates to use plain text passwords with TEXT prefix.
-- Fix for
0000427: pg_enc emits wrong warnings
-- Fix for
0000426: Pgpool-II contines to emit warning messages
Bo Peng [Thu, 30 Aug 2018 00:41:31 +0000 (09:41 +0900)]
Add missing gram.c by previous commit.
Tatsuo Ishii [Wed, 29 Aug 2018 02:58:36 +0000 (11:58 +0900)]
Add regression test for SSL connection.
This tests SSL connection between frontend <--> Pgpool-II and
Pgpool-II <--> backend.
Bo Peng [Tue, 28 Aug 2018 09:20:07 +0000 (18:20 +0900)]
Import PostgreSQL 11 beta3 parser.
Tatsuo Ishii [Thu, 23 Aug 2018 12:12:29 +0000 (21:12 +0900)]
Unbreak pgpool_setup and regression tests against pre-10 PostgreSQL.
Commit
26446126f36dcd34ea9032ac934aafe63acc0eee broke pgpool_setup and
regression tests against pre-10 PostgreSQL because they unconditionally
use feature introduced in PostgreSQL 10, i.e. SCRAM authentication. To
fix this, check PostgreSQL version using initdb -v and not use
PostgreSQL 10 specific feature if PostgreSQL 9.6 or earlier is used.
In this case regression tests 020, 021 and 022 always success.
Tatsuo Ishii [Wed, 22 Aug 2018 07:09:19 +0000 (16:09 +0900)]
Update copyright year.
Tatsuo Ishii [Wed, 22 Aug 2018 07:01:21 +0000 (16:01 +0900)]
Add notes regarding failover script.
It's not recommended to access against Pgpool-II itself from
failover/failback scripts.
Tatsuo Ishii [Wed, 22 Aug 2018 04:24:08 +0000 (13:24 +0900)]
Fix memory leak and typo in comments.
Tatsuo Ishii [Tue, 21 Aug 2018 08:33:52 +0000 (17:33 +0900)]
Fix memory leak pointed out by Coverity.
Bo Peng [Mon, 20 Aug 2018 08:06:35 +0000 (17:06 +0900)]
Add missing new file to previous commit.
Bo Peng [Mon, 20 Aug 2018 08:04:45 +0000 (17:04 +0900)]
Move pgproto header files to "include/pgproto".
Bo Peng [Mon, 20 Aug 2018 08:00:55 +0000 (17:00 +0900)]
Change test file name to avoid make dist error due to too long file name.
Bo Peng [Mon, 20 Aug 2018 07:25:20 +0000 (16:25 +0900)]
Change distdir to include new files.
Bo Peng [Mon, 20 Aug 2018 05:36:43 +0000 (14:36 +0900)]
Prepare 4.0alpha1.
Bo Peng [Mon, 20 Aug 2018 05:13:29 +0000 (14:13 +0900)]
Change follow_master_command description new master -> new primary.
Bo Peng [Mon, 20 Aug 2018 05:07:08 +0000 (14:07 +0900)]
Improve 4.0 release note.
Bo Peng [Mon, 20 Aug 2018 04:49:44 +0000 (13:49 +0900)]
Add .gitignore to doc and doc.ja.
Bo Peng [Mon, 20 Aug 2018 04:43:06 +0000 (13:43 +0900)]
Add .gitignore to pgenc and pgproto.
Patch provided by Jesper Pedersen.
Muhammad Usama [Sun, 19 Aug 2018 10:18:23 +0000 (15:18 +0500)]
Some document updates for SCRAM authentication feature
Patch contributed by Jesper Pedersen <jesper.pedersen@redhat.com>
against SCRAM branch and updated by me against master
Muhammad Usama [Sun, 19 Aug 2018 09:46:49 +0000 (14:46 +0500)]
Use failover instead of fail-over pr fail_over
Fix mistakes where "fail_over" and "fail-over" were used instead of the
"failover". And that also includes a wrongly spelled configuration parameter
"fail_over_on_backend_error",
Now we throw a warning message when old config name fail_over_on_backend_error
is used instead of failover_on_backend_error,
Using the old config variable name will have no effect.
Tatsuo Ishii [Fri, 17 Aug 2018 08:23:14 +0000 (17:23 +0900)]
Run pgindent.
Fix and unify indentation by using PostgreSQL 11's pgindent command.
Tatsuo Ishii [Fri, 17 Aug 2018 04:29:54 +0000 (13:29 +0900)]
Deal with pgindent.
Bo Peng [Fri, 17 Aug 2018 05:44:05 +0000 (14:44 +0900)]
Add Pgpool-II 4.0 release note.
Bo Peng [Fri, 17 Aug 2018 03:06:38 +0000 (12:06 +0900)]
Fix test directory name typos.
Bo Peng [Fri, 17 Aug 2018 02:56:52 +0000 (11:56 +0900)]
Add pgproto to Pgpool-II.
Now by installing pgpool, pgproto will also be installed.
Patch provided by Takuma Hoshiai.
Muhammad Usama [Thu, 16 Aug 2018 16:34:32 +0000 (21:34 +0500)]
Feature: Add SCRAM and Certificate authentication support
New feature to add scram and cert authentication method support in Pgpool-II.
Apart from supporting the new authentication methods the commit also includes
the following enhancements and changes in the authentication framework
of Pgpool-II
Different auth methods for frontend and backend for user session
================================================================
Now it possible to use different authentication method for client
application and backend PostgreSQL servers.
For example, a client application can use scram-sha-256 to connect to Pgpool-II
which in turn can use trust or md5 authentication to connect to
PostgreSQL backend for the same session.
Use MD5 and SCRAM without pool_passwd
=====================================
New configuration parameter allow_clear_text_frontend_auth, enables the Pgpool-II
to use clear-text-password authentication with frontend clients when pool_passwd
file does not contains the password for the connecting user.
For example: suppose PostgreSQL servers has a user named "some_user" which can
connect to database using SCRAM authentication, Now for this "some_user" to
connect to PostgreSQL using SCRAM through Pgpool-II we must have the some_user's
password stored in the pool_passwd file, but if in some case when pool_passwd does
not have the entry of "some_user" and allow_clear_text_frontend_auth is enabled
in the pgpool.conf then Pgpool-II will ask the connecting frontend to use
clear-text-password auth method for authentication, and after receiving the
password from the client, Pgpool-II will use that password to authenticate with
backend using the required SCRAM auth.
Note: allow_clear_text_frontend_auth only works when pool_hba.conf is not enabled.
Encrypted passwords in pool_passwd file
=======================================
Since the SCRAM authentication method explicitly guards against the
man-in-middle type attacks, so to use such authentication methods Pgpool-II
requires the PostgreSQL user password to authenticate with the backend.
But as storing the clear text password in the "pool_passwd" file is never a good
idea, so now you can store the AES256-CBC encrypted password in the "pool_passwd".
To store the AES encrypted password in the "pool_passwd" the password is first
encrypted using the AES256 encryption with the user provided key and then the
encrypted password is base64 encoded and AES prefix is added to
the encoded string.
New pg_enc utility to create encrypted passwords
================================================
A new utility pg_enc is added to create AES encrypted passwords. The utility
works similar in most ways as pg_md5 utility, with a some small differences,
pg_enc also requires the key for encrypting the password entries. later that
same key is required by Pgpool-II to decrypt the passwords to be used for
authentication.
Note: Pgpool-II must be build with ssl (--with-openssl) support to use
this encrypted password feature.
Providing encryption key to Pgpool-II
=====================================
If you have AES encrypted passwords stored in the pool_passwd file, then
Pgpool-II will require the decryption key to decrypt the passwords before
using them, Pgpool-II tries to read the decryption key at startup from
the pgpoolkey file.
By default the Pgpool-II will look for the pgpoolkey file in user's home
directory or the file referenced by environment variable PGPOOLKEYFILE.
You can also specify the key file using the (-k, --key-file=KEY_FILE)
command line argument to the Pgpool-II binary.
Encrypted Passwords in pgpool.conf
==================================
The commit also allows to specify the AES encrypted password in the pgpool.conf
file for healh_check_user, sr_check_user, wd_lifecheck_user and recovery_user
users, Additionally if the password field for any of these users is left blank
in pgpool conf then Pgpool-II will first try to get the password for that user
from pool_passwd file before using the empty password for the connection.
So now pgpool.conf can be made password free and single pool_passwd file can be
used to store all passwords for internal and external user connection
Documentation updates and regression test cases for the
feature are also part of the commit.
Thanks to jesperpedersen <jesper.pedersen@redhat.com> for helping
in documentation and testing for the feature
Tatsuo Ishii [Thu, 16 Aug 2018 06:38:33 +0000 (15:38 +0900)]
Fix too small buffer size in some configuration file process.
This was found by newer version of gcc warnings.
pool_config_variables.c: In function ‘BackendFlagsShowFunc’:
pool_config_variables.c:3809:57: warning: ‘__builtin_snprintf’ output truncated before the last format character [-Wformat-truncation=]
snprintf(buffer, sizeof(buffer), "DISALLOW_TO_FAILOVER");
^
In file included from /usr/include/stdio.h:862:0,
from pool_config_variables.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin_snprintf’ output 21 bytes into a destination of size 20
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bo Peng [Wed, 15 Aug 2018 00:13:11 +0000 (09:13 +0900)]
Improve documetation about "black_query_pattern_list".
Bo Peng [Tue, 14 Aug 2018 13:43:49 +0000 (22:43 +0900)]
Improve pg_md5 docs and error message.
Patch provided by Jesper Pedersen and modified by me.
Bo Peng [Fri, 10 Aug 2018 09:12:45 +0000 (18:12 +0900)]
Fix that if the last character of black_query_pattern_list is not ";",
the last SQL pattern was ignored.
Now wether or not the last character ";" exists, the SQL patterns
will be correctly handled.
Bo Peng [Fri, 10 Aug 2018 06:22:49 +0000 (15:22 +0900)]
Fix document example errors about "black_query_pattern_list".
Bo Peng [Fri, 10 Aug 2018 05:02:21 +0000 (14:02 +0900)]
Add some comments about performance to "black_query_pattern_list" docs.
Bo Peng [Fri, 10 Aug 2018 04:16:02 +0000 (13:16 +0900)]
Add definition of PGLIB in regress.sh.
Patch provided by Jesper Pedersen.