Fix for 0000419: pg_md5: -m removes users
authorMuhammad Usama <m.usama@gmail.com>
Tue, 30 Oct 2018 13:08:52 +0000 (18:08 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Tue, 30 Oct 2018 13:11:17 +0000 (18:11 +0500)
commitc78cb93e5337c825e463c3c6cfd418bcf0eccb31
tree5d7af2150edd4c96e516b53d6415e92082d81dde
parentffd6bfa8c212090e3681d7959b8ec84d42070cd9
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.
src/auth/pool_passwd.c
src/include/auth/pool_passwd.h