docs/administration.md:239 states:
Every one of them requires superuser, enforced in C at the point of use
That is no longer true on main, and the test that would have caught it does not
cover the functions that broke it.
The state on main
| function |
gate |
in the docs table |
in server_file_privilege.sh |
import_parquet, read_parquet, parquet_schema, export_parquet, the Arrow pair |
superuser() |
yes |
yes |
file_split_offsets |
has_privs_of_role(..., ROLE_PG_READ_SERVER_FILES) |
no |
no |
parallel_copy |
same role check |
no |
no |
grep -n "parallel_copy\|file_split_offsets" docs/administration.md returns
nothing, and the same grep over test/server_file_privilege.sh returns nothing.
So two server-file functions on main sit outside the documented model and outside
the privilege boundary test. A non-superuser holding pg_read_server_files can
read a server file through parallel_copy and cannot through import_parquet:
the same capability behind two different bars.
How it got here
I raised this reviewing #323 and marked it "reported, not reproduced". It merged
without being addressed, which is on me for not carrying it forward. PR #329
(parallel_export_parquet, gated on pg_write_server_files) would add a third,
and its author flagged the inconsistency in the PR body rather than letting it
pass silently.
What to decide, not just fix
The role gate is arguably the better model: it is what core COPY FROM 'file'
uses, and pg_read_server_files/pg_write_server_files exist precisely so the
capability can be granted without superuser. The problem is not which bar is right,
it is that there are two bars and the documentation asserts one.
- Standardise on the role checks and relax the older functions. A deliberate
privilege loosening, so it needs saying out loud in the docs and the CHANGELOG.
- Standardise on
superuser() and tighten the two newer functions. Breaking
for anyone already using them, though they are days old.
- Keep both deliberately and document why. Weakest option: the split does not
track anything a user would predict.
Whichever is chosen, two things follow:
docs/administration.md needs the blanket sentence replaced and the table
completed.
test/server_file_privilege.sh should be data-driven over the full set, so a new
server-file function without a privilege check fails the gate instead of slipping
past it. That is the durable half. The docs drifted once already and this issue
is the evidence they will again.
docs/administration.md:239states:That is no longer true on main, and the test that would have caught it does not
cover the functions that broke it.
The state on main
server_file_privilege.shimport_parquet,read_parquet,parquet_schema,export_parquet, the Arrow pairsuperuser()file_split_offsetshas_privs_of_role(..., ROLE_PG_READ_SERVER_FILES)parallel_copygrep -n "parallel_copy\|file_split_offsets" docs/administration.mdreturnsnothing, and the same grep over
test/server_file_privilege.shreturns nothing.So two server-file functions on main sit outside the documented model and outside
the privilege boundary test. A non-superuser holding
pg_read_server_filescanread a server file through
parallel_copyand cannot throughimport_parquet:the same capability behind two different bars.
How it got here
I raised this reviewing #323 and marked it "reported, not reproduced". It merged
without being addressed, which is on me for not carrying it forward. PR #329
(
parallel_export_parquet, gated onpg_write_server_files) would add a third,and its author flagged the inconsistency in the PR body rather than letting it
pass silently.
What to decide, not just fix
The role gate is arguably the better model: it is what core
COPY FROM 'file'uses, and
pg_read_server_files/pg_write_server_filesexist precisely so thecapability can be granted without superuser. The problem is not which bar is right,
it is that there are two bars and the documentation asserts one.
privilege loosening, so it needs saying out loud in the docs and the CHANGELOG.
superuser()and tighten the two newer functions. Breakingfor anyone already using them, though they are days old.
track anything a user would predict.
Whichever is chosen, two things follow:
docs/administration.mdneeds the blanket sentence replaced and the tablecompleted.
test/server_file_privilege.shshould be data-driven over the full set, so a newserver-file function without a privilege check fails the gate instead of slipping
past it. That is the durable half. The docs drifted once already and this issue
is the evidence they will again.