Fix bug with initializing pool_password in daemon mode.
authorTatsuo Ishii <ishii at sraoss.co.jp>
Mon, 23 May 2011 10:55:36 +0000 (10:55 +0000)
committerTatsuo Ishii <ishii at sraoss.co.jp>
Mon, 23 May 2011 10:55:36 +0000 (10:55 +0000)
commite4ad2aeea2fd1171cb8df1728efd5221ae834685
tree126f19c9ac736cbe333234c9ee799374ed61e11c
parent1f0d3d613b84b86cb0d462acbd5d861cf52cba2a
Fix bug with initializing pool_password in daemon mode.
Patch from Nicolas Thauvin.

To: pgpool-hackers@pgfoundry.org
Date: Tue, 17 May 2011 17:08:56 +0200
------------------------------------------------------------------------
When in daemon mode, connection hangs when using md5 authentication
method. The child process in charge of the client goes into an infinite
loop in pool_get_passwd() while trying to read the pool_passwd file.

The cause of the problem comes from the daemonize() function that closes
all file descriptors starting from 3, including the file descriptor of
the pool_passwd file. When pgpool gets to pool_get_passwd, the null
checks on the passwd_fd variable fail because the variable was not reset
to a NULL value.
main.c