Commit 301ca0d9 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix AclResult vs bool type mix-up

Using AclResult as a bool or vice versa works by accident, but it's
unusual and possibly confusing style, so write it out more explicitly.
parent b1fc51a3
...@@ -101,8 +101,9 @@ pgrowlocks(PG_FUNCTION_ARGS) ...@@ -101,8 +101,9 @@ pgrowlocks(PG_FUNCTION_ARGS)
/* check permissions: must have SELECT on table or be in pg_stat_scan_tables */ /* check permissions: must have SELECT on table or be in pg_stat_scan_tables */
aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(), aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(),
ACL_SELECT) || ACL_SELECT);
is_member_of_role(GetUserId(), DEFAULT_ROLE_STAT_SCAN_TABLES); if (aclresult != ACLCHECK_OK)
aclresult = is_member_of_role(GetUserId(), DEFAULT_ROLE_STAT_SCAN_TABLES) ? ACLCHECK_OK : ACLCHECK_NO_PRIV;
if (aclresult != ACLCHECK_OK) if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, ACL_KIND_CLASS, aclcheck_error(aclresult, ACL_KIND_CLASS,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment