pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor aclcheck functions
Date: Sun, 13 Nov 2022 08:09:39 +0000
Message-ID: <E1ou83e-000t0x-Pl@gemulon.postgresql.org> (raw)

Refactor aclcheck functions

Instead of dozens of mostly-duplicate pg_foo_aclcheck() functions,
write one common function object_aclcheck() that can handle almost all
of them.  We already have all the information we need, such as which
system catalog corresponds to which catalog table and which column is
the ACL column.

There are a few pg_foo_aclcheck() that don't work via the generic
function and have special APIs, so those stay as is.

I also changed most pg_foo_aclmask() functions to static functions,
since they are not used outside of aclchk.c.

Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: Antonin Houska <ah@cybertec.at>
Discussion: https://www.postgresql.org/message-id/flat/95c30f96-4060-2f48-98b5-a4392d3b6066@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c727f511bd7bf3c58063737bcf7a8f331346f253

Modified Files
--------------
contrib/dblink/dblink.c                |   2 +-
src/backend/access/common/tupdesc.c    |   2 +-
src/backend/catalog/aclchk.c           | 625 ++++++++-------------------------
src/backend/catalog/namespace.c        |  13 +-
src/backend/catalog/pg_aggregate.c     |  10 +-
src/backend/catalog/pg_operator.c      |   2 +-
src/backend/commands/aggregatecmds.c   |   3 +-
src/backend/commands/alter.c           |   6 +-
src/backend/commands/collationcmds.c   |   3 +-
src/backend/commands/conversioncmds.c  |   6 +-
src/backend/commands/dbcommands.c      |   4 +-
src/backend/commands/extension.c       |   5 +-
src/backend/commands/foreigncmds.c     |  10 +-
src/backend/commands/functioncmds.c    |  26 +-
src/backend/commands/indexcmds.c       |   8 +-
src/backend/commands/opclasscmds.c     |   4 +-
src/backend/commands/operatorcmds.c    |  16 +-
src/backend/commands/publicationcmds.c |   5 +-
src/backend/commands/schemacmds.c      |   7 +-
src/backend/commands/tablecmds.c       |  16 +-
src/backend/commands/tablespace.c      |   4 +-
src/backend/commands/trigger.c         |   2 +-
src/backend/commands/tsearchcmds.c     |   4 +-
src/backend/commands/typecmds.c        |  16 +-
src/backend/executor/execExpr.c        |  11 +-
src/backend/executor/execSRF.c         |   3 +-
src/backend/executor/nodeAgg.c         |  10 +-
src/backend/executor/nodeWindowAgg.c   |   8 +-
src/backend/optimizer/util/clauses.c   |   4 +-
src/backend/parser/parse_utilcmd.c     |   2 +-
src/backend/tcop/fastpath.c            |   5 +-
src/backend/utils/adt/acl.c            | 102 +++---
src/backend/utils/adt/dbsize.c         |   5 +-
src/backend/utils/fmgr/fmgr.c          |   4 +-
src/backend/utils/init/postinit.c      |   2 +-
src/include/utils/acl.h                |  44 +--
src/pl/tcl/pltcl.c                     |   2 +-
37 files changed, 319 insertions(+), 682 deletions(-)



Message-ID: <E1ou83e-000t0x-Pl@gemulon.postgresql.org>
Permalink:  ../E1ou83e-000t0x-Pl@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ou83e-000t0x-Pl@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Refactor aclcheck functions
  In-Reply-To: <E1ou83e-000t0x-Pl@gemulon.postgresql.org>
  References: <E1ou83e-000t0x-Pl@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox