Add a check_hook for output_plugin_libraries

I omitted explicit syntax validation of output_plugin_libraries in
226e49cbed. [ALTER SYSTEM] SET does this implicitly due to the parser
grammar, but a DBA could still accidentally put a bad value into
postgresql.conf, and a superuser could do the same with connection
options or set_config(). Logical replication would then fail later on.

This is an annoying papercut for a security option to have, so reject
these cases immediately in a check_hook.

Tests by Hayato Kuroda.

Co-authored-by: Hayato Kuroda <[email protected]>
Reported-by: Fujii Masao <[email protected]>
Reviewed-by: Hayato Kuroda <[email protected]>
Discussion: 
https://postgr.es/m/CAOYmi%2BkBsG5rNRb1j2VjgTKg8HY90e7vSvZPLeouiAc6nXP9XA%40mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0c8611c6e7e614ba6cc224a6b819ef2862e46c71

Modified Files
--------------
src/backend/replication/logical/logical.c | 12 ++---------
src/backend/utils/misc/guc.c              | 35 ++++++++++++++++++++++++++++++-
src/test/regress/expected/guc.out         |  4 ++++
src/test/regress/sql/guc.sql              |  3 +++
4 files changed, 43 insertions(+), 11 deletions(-)

Reply via email to