public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tefft, Michael J <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected] <[email protected]>
Subject: RE: Removing the default grant of EXECUTE on functions/procedures to PUBLIC
Date: Fri, 5 Jul 2024 18:42:54 +0000
Message-ID: <BN8PR04MB6289726F36244ED95C4FD3F3D0DF2@BN8PR04MB6289.namprd04.prod.outlook.com> (raw)
In-Reply-To: <[email protected]>
References: <BN8PR04MB6289E694A40BE7DF913754A1D0DF2@BN8PR04MB6289.namprd04.prod.outlook.com>
	<[email protected]>
	<BN8PR04MB6289DE86BD158D8785B302C5D0DF2@BN8PR04MB6289.namprd04.prod.outlook.com>
	<[email protected]>

I apologize, that was sloppy.
I was using the acldefault() function with pg_roles, like this:
=> select rolname,  acldefault('f',oid) from pg_roles where rolname like 'mjt%' order by 1;
  rolname  |              acldefault
-----------+--------------------------------------
mjt_test1 | {=X/mjt_test1,mjt_test1=X/mjt_test1}
mjt_test2 | {=X/mjt_test2,mjt_test2=X/mjt_test2}
(2 rows)

I had issued
alter default privileges for role mjt_test1 revoke execute on functions from public;
but had not done a similar ALTER for mjt_test2. And so I was surprised that they both showed a default =X/rolename.

Examining  \ddp and its underlying quuery, I see that view column pg_default_acl gets a new row with defaclacl populated after the ALTER DEFAULT PRIVILEGES.

Thanks very much for your guidance, I am on track now.

Mike Tefft

From: Tom Lane <[email protected]>
Sent: Friday, July 5, 2024 2:22 PM
To: Tefft, Michael J <[email protected]>
Cc: [email protected]
Subject: Re: Removing the default grant of EXECUTE on functions/procedures to PUBLIC

"Tefft, Michael J" <Michael. J. Tefft@ snapon. com> writes: > I was checking pg_roles. acl_default to see if my role-level ALTER DEFAULT PRIVILEGES had been effective. But I see the same content both before and after the ALTEr. Er, what?


"Tefft, Michael J" <[email protected]<mailto:[email protected]>> writes:

> I was checking pg_roles.acl_default to see if my role-level ALTER DEFAULT PRIVILEGES had been effective. But I see the same content both before and after the ALTEr.



Er, what?  There's no column named acl_default in pg_roles, nor any

other standard PG view.



psql's "\ddp" command is the most usual way to examine current

defaults:



regression=# create user joe;

CREATE ROLE

regression=# ALTER DEFAULT PRIVILEGES FOR USER joe REVOKE EXECUTE ON FUNCTIONS FROM public;

ALTER DEFAULT PRIVILEGES

regression=# \ddp

           Default access privileges

 Owner | Schema |   Type   | Access privileges

-------+--------+----------+-------------------

 joe   |        | function | joe=X/joe

(1 row)



                                       regards, tom lane


view thread (7+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: RE: Removing the default grant of EXECUTE on functions/procedures to PUBLIC
  In-Reply-To: <BN8PR04MB6289726F36244ED95C4FD3F3D0DF2@BN8PR04MB6289.namprd04.prod.outlook.com>

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

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