Fix segmentation fault of child that occurs when startup packet has
authorYugo Nagata <nagata@sraoss.co.jp>
Tue, 2 Jul 2013 02:12:20 +0000 (11:12 +0900)
committerYugo Nagata <nagata@sraoss.co.jp>
Tue, 2 Jul 2013 02:12:20 +0000 (11:12 +0900)
commitd493dd2b7d2065fb554654b137ecd587564f0043
tree0185809a8fdcc597bb82d41ed3f5ce130dad3cb7
parent26ed7692523b80139847accd56cc414e92eafdcd
Fix segmentation fault of child that occurs when startup packet has
no PostgreSQL user information.

When a startup packet has no PostgreSQL user specified, pgpool-II
terminated abnormally. You can reproduce it by

 $ psql -p 9999 -U ''

If enable_pool_hba is on, a child process terminates by segmentation
fault. Otherwise if enable_pool_hba is off, the error message is

 ERROR: pool_discard_cp: cannot get connection pool for user (null) database (null)

In both cases, psql terminates with no message on frontend.

To resolve it, if PostgreSQL user is not specified in startup packet,
the message as following is output to both log and frontend. This is
the same behavior as PostgreSQL.

 FATAL: no PostgreSQL user name specified in startup packet
child.c