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

Commit741e952

Browse files
committed
Make currtid() functions require SELECT privileges on the target table.
While it's not clear that TID linkage info is of any great use to anefarious user, it's certainly unexpected that these functions wouldn'tinsist on read privileges.
1 parent56f3fb3 commit741e952

File tree

1 file changed

+19
-1
lines changed
  • src/backend/utils/adt

1 file changed

+19
-1
lines changed

‎src/backend/utils/adt/tid.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/tid.c,v 1.57 2007/01/05 22:19:42 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/tid.c,v 1.58 2007/08/27 00:57:36 tgl Exp $
1212
*
1313
* NOTES
1414
* input routine largely stolen from boxin().
@@ -24,7 +24,9 @@
2424
#include"catalog/namespace.h"
2525
#include"catalog/pg_type.h"
2626
#include"libpq/pqformat.h"
27+
#include"miscadmin.h"
2728
#include"parser/parsetree.h"
29+
#include"utils/acl.h"
2830
#include"utils/builtins.h"
2931

3032

@@ -326,6 +328,7 @@ currtid_byreloid(PG_FUNCTION_ARGS)
326328
ItemPointertid=PG_GETARG_ITEMPOINTER(1);
327329
ItemPointerresult;
328330
Relationrel;
331+
AclResultaclresult;
329332

330333
result= (ItemPointer)palloc(sizeof(ItemPointerData));
331334
if (!reloid)
@@ -335,6 +338,13 @@ currtid_byreloid(PG_FUNCTION_ARGS)
335338
}
336339

337340
rel=heap_open(reloid,AccessShareLock);
341+
342+
aclresult=pg_class_aclcheck(RelationGetRelid(rel),GetUserId(),
343+
ACL_SELECT);
344+
if (aclresult!=ACLCHECK_OK)
345+
aclcheck_error(aclresult,ACL_KIND_CLASS,
346+
RelationGetRelationName(rel));
347+
338348
if (rel->rd_rel->relkind==RELKIND_VIEW)
339349
returncurrtid_for_view(rel,tid);
340350

@@ -354,9 +364,17 @@ currtid_byrelname(PG_FUNCTION_ARGS)
354364
ItemPointerresult;
355365
RangeVar*relrv;
356366
Relationrel;
367+
AclResultaclresult;
357368

358369
relrv=makeRangeVarFromNameList(textToQualifiedNameList(relname));
359370
rel=heap_openrv(relrv,AccessShareLock);
371+
372+
aclresult=pg_class_aclcheck(RelationGetRelid(rel),GetUserId(),
373+
ACL_SELECT);
374+
if (aclresult!=ACLCHECK_OK)
375+
aclcheck_error(aclresult,ACL_KIND_CLASS,
376+
RelationGetRelationName(rel));
377+
360378
if (rel->rd_rel->relkind==RELKIND_VIEW)
361379
returncurrtid_for_view(rel,tid);
362380

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp