git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: a49927f) | patch
pg_logicalinspect: Fix possible crash when passing a directory path.
2025年3月11日 16:56:40 +0000 (09:56 -0700)
2025年3月11日 16:56:40 +0000 (09:56 -0700)
commit bd65cb3cd48a7a5ce48b26f8031ad3968efed87e
pg_logicalinspect: Fix possible crash when passing a directory path.

Previously, pg_logicalinspect functions were too trusting of their
input and blindly passed it to SnapBuildRestoreSnapshot(). If the
input pointed to a directory, the server could a PANIC error while
attempting to fsync_fname() with isdir=false on a directory.

This commit adds validation checks for input filenames and passes the
LSN extracted from the filename to SnapBuildRestoreSnapshot() instead
of the filename itself. It also adds regression tests for various
input patterns and permission checks.

Bug: #18828
Reported-by: Robins Tharakan <tharakan@gmail.com>
Co-authored-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Co-authored-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/18828-0f4701c635064211@postgresql.org
contrib/pg_logicalinspect/Makefile diff | blob | blame | history
contrib/pg_logicalinspect/expected/pg_logicalinspect.out [new file with mode: 0644] blob
contrib/pg_logicalinspect/pg_logicalinspect.c diff | blob | blame | history
contrib/pg_logicalinspect/sql/pg_logicalinspect.sql [new file with mode: 0644] blob
src/backend/replication/logical/snapbuild.c diff | blob | blame | history
src/include/replication/snapbuild_internal.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /