Skip to content

Commit

Permalink
Add some more functions to ALLOWED_ADMIN_FUNCTIONS (#8139)
Browse files Browse the repository at this point in the history
Fixes #8128.

Also addresses a failure reported in #8138, but that only exposes some
other failures.
  • Loading branch information
msullivan authored Dec 17, 2024
1 parent 8d37e82 commit df48251
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion edb/pgsql/resolver/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ def eval_TypeCast(
'pg_visible_in_snapshot',
'pg_xact_commit_timestamp',
'pg_xact_status',
'pg_partition_ancestors',
'pg_backend_pid',
'pg_wal_lsn_diff',
'pg_last_wal_replay_lsn',
'pg_current_wal_flush_lsn',
'pg_relation_is_publishable',
}
)

Expand All @@ -239,7 +245,7 @@ def eval_FuncCall(

if fn_name.startswith('pg_') and fn_name not in ALLOWED_ADMIN_FUNCTIONS:
raise errors.QueryError(
"forbidden function",
f"forbidden function '{fn_name}'",
span=expr.span,
pgext_code=pgerror.ERROR_INSUFFICIENT_PRIVILEGE,
)
Expand Down

0 comments on commit df48251

Please sign in to comment.