Why ACL_EXECUTE is checked on FindConversion()? - Mailing list pgsql-hackers

From KaiGai Kohei
Subject Why ACL_EXECUTE is checked on FindConversion()?
Date
Msg-id 4A8BB095.6090501@ak.jp.nec.com
Whole thread Raw
Responses Re: Why ACL_EXECUTE is checked on FindConversion()?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
When FindConversion() is called, it also checks current user's ACL_EXECUTE
privilege on the conproc of the fetched conversion.

Why this check is applied on FindConversion(), instead of FindDefaultConversion()?

The FindConversion() returns the OID of conversion for the given name and
namespace, or InvalidOid if not found or user does not have ACL_EXECUTE
privilege.
It is called from DropConversionsCommand(), RenameConversion(),
AlterConversionOwner() and CommentConversion(), to obtain OID of the target
conversion to be modified by DDL statement.

On the other hand, FindDefaultConversionProc() does not apply such kind of
permission checks, though it is called from SetClientEncoding().
The conversion procedure is implicitly called when user communicates to
the server backend, so it seems to me quite natural if FindDefaultConversionProc()
checks user's ACL_EXECUTE privilege.

But it is checked when we lookup the target conversion on DDL statement.

It's unclear for me what is the intension of this check.

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>


pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: PQgetlength vs. octet_length()
Next
From: Itagaki Takahiro
Date:
Subject: FDW-based dblink (WIP)