postgresql/contrib/adminpack
Joe Conway 96d1f423f9 Read until EOF vice stat-reported size in read_binary_file
read_binary_file(), used by SQL functions pg_read_file() and friends,
uses stat to determine file length to read, when not passed an explicit
length as an argument. This is problematic, for example, if the file
being read is a virtual file with a stat-reported length of zero.
Arrange to read until EOF, or StringInfo data string lenth limit, is
reached instead.

Original complaint and patch by me, with significant review, corrections,
advice, and code optimizations by Tom Lane. Backpatched to v11. Prior to
that only paths relative to the data and log dirs were allowed for files,
so no "zero length" files were reachable anyway.

Reviewed-By: Tom Lane
Discussion: https://postgr.es/m/flat/969b8d82-5bb2-5fa8-4eb1-f0e685c5d736%40joeconway.com
Backpatch-through: 11
2020-07-04 06:26:53 -04:00
..
expected Read until EOF vice stat-reported size in read_binary_file 2020-07-04 06:26:53 -04:00
sql Add pg_file_sync() to adminpack extension. 2020-01-24 20:42:52 +09:00
.gitignore adminpack: Add test suite 2017-09-14 22:22:59 -04:00
adminpack--1.0--1.1.sql adminpack: Revoke EXECUTE on pg_logfile_rotate() 2018-05-07 10:10:33 -04:00
adminpack--1.0.sql Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
adminpack--1.1--2.0.sql adminpack: Revoke EXECUTE on pg_logfile_rotate() 2018-05-07 10:10:33 -04:00
adminpack--2.0--2.1.sql Add pg_file_sync() to adminpack extension. 2020-01-24 20:42:52 +09:00
adminpack.c Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
adminpack.control Add pg_file_sync() to adminpack extension. 2020-01-24 20:42:52 +09:00
Makefile Add pg_file_sync() to adminpack extension. 2020-01-24 20:42:52 +09:00