Fix handling of previous password hooks in passwordcheck

Michael Paquier <michael@paquier.xyz>

Commit: 957b822b5294bd3e19aab21b6cb937822db11673
Author: Michael Paquier <michael@paquier.xyz>
Date: 2019-08-01T00:38:20Z
Releases: 9.6.15
Fix handling of previous password hooks in passwordcheck

When piling up loading of modules using check_password_hook_type,
loading passwordcheck would remove any trace of a previously-loaded
hook.  Unloading the module would also cause previous hooks to be
entirely gone.

Reported-by: Rafael Castro
Author: Michael Paquier
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/15932-78f48f9ef166778c@postgresql.org
Backpatch-through: 9.4

Files

PathChange+/−
contrib/passwordcheck/passwordcheck.c modified +20 −0

Discussion