Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit301ca0d

Browse files
committed
Fix AclResult vs bool type mix-up
Using AclResult as a bool or vice versa works by accident, but it'sunusual and possibly confusing style, so write it out more explicitly.
1 parentb1fc51a commit301ca0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎contrib/pgrowlocks/pgrowlocks.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ pgrowlocks(PG_FUNCTION_ARGS)
101101

102102
/* check permissions: must have SELECT on table or be in pg_stat_scan_tables */
103103
aclresult=pg_class_aclcheck(RelationGetRelid(rel),GetUserId(),
104-
ACL_SELECT)||
105-
is_member_of_role(GetUserId(),DEFAULT_ROLE_STAT_SCAN_TABLES);
104+
ACL_SELECT);
105+
if (aclresult!=ACLCHECK_OK)
106+
aclresult=is_member_of_role(GetUserId(),DEFAULT_ROLE_STAT_SCAN_TABLES) ?ACLCHECK_OK :ACLCHECK_NO_PRIV;
106107

107108
if (aclresult!=ACLCHECK_OK)
108109
aclcheck_error(aclresult,ACL_KIND_CLASS,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp