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

Commita41e46b

Browse files
committed
Require SELECT privilege on a table to do dblink_get_pkey(). This is
not all that exciting when the system catalogs are readable by all,but some people try to lock them down, and would not like this sort ofend run ...
1 parentcc26599 commita41e46b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎contrib/dblink/dblink.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.64 2007/07/08 17:12:38 joe Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.65 2007/08/27 01:24:50 tgl Exp $
1212
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -51,6 +51,7 @@
5151
#include"nodes/pg_list.h"
5252
#include"parser/parse_type.h"
5353
#include"tcop/tcopprot.h"
54+
#include"utils/acl.h"
5455
#include"utils/array.h"
5556
#include"utils/builtins.h"
5657
#include"utils/dynahash.h"
@@ -1686,9 +1687,17 @@ get_pkey_attnames(Oid relid, int16 *numatts)
16861687
char**result=NULL;
16871688
Relationrel;
16881689
TupleDesctupdesc;
1690+
AclResultaclresult;
16891691

1690-
/* open relation using relid, get tupdesc */
1692+
/* open relation using relid,check permissions,get tupdesc */
16911693
rel=relation_open(relid,AccessShareLock);
1694+
1695+
aclresult=pg_class_aclcheck(RelationGetRelid(rel),GetUserId(),
1696+
ACL_SELECT);
1697+
if (aclresult!=ACLCHECK_OK)
1698+
aclcheck_error(aclresult,ACL_KIND_CLASS,
1699+
RelationGetRelationName(rel));
1700+
16921701
tupdesc=rel->rd_att;
16931702

16941703
/* initialize numatts to 0 in case no primary key exists */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp