Why ACL_EXECUTE is checked on FindConversion()?

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Why ACL_EXECUTE is checked on FindConversion()?
Date: 2009-08-19 07:58:13
Message-ID: 4A8BB095.6090501@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)ak(dot)jp(dot)nec(dot)com>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Itagaki Takahiro 2009-08-19 08:07:13 FDW-based dblink (WIP)
Previous Message Albe Laurenz 2009-08-19 07:47:43 Re: PQgetlength vs. octet_length()