Re: One question about security label command

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, 张元超 <zhangyuanchao(at)highgo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: One question about security label command
Date: 2015-03-10 13:28:56
Message-ID: CADyhKSV98jNR5WK4zcOwk=8+pcNrSVwhkkhXdWCGapXmhvY_Sg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch revises error message when security label
is specified on unsupported object.
getObjectTypeDescription() may be better than oid of catalog.

postgres=# SECURITY LABEL FOR selinux ON ROLE kaigai
postgres-# IS 'system_u:object_r:unlabeled_t:s0';
ERROR: sepgsql provider does not support labels on role

2015-03-09 23:55 GMT+09:00 Robert Haas <robertmhaas(at)gmail(dot)com>:
> On Tue, Mar 3, 2015 at 5:01 AM, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:
>> From standpoint of SQL syntax, yep, SECURITY LABEL command support
>> the object types below, however, it fully depends on security label
>> provider; sepgsql.so in this case.
>> At this moment, it supports database, schema, function, tables and
>> column are supported by sepgsql. So, it is expected behavior.
>
> If the core system supports labels on other object types and sepgsql
> does not, it should give a better error for those cases, like:
>
> ERROR: sepgsql provider does not support labels on roles
>
> Errors like "ERROR: unsupported object type: 1260" are a good way to
> report a failure that is never expected to happen, but they shouldn't
> be used as user-facing error messages.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

Attachment Content-Type Size
security-label-errmsg.patch application/octet-stream 544 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-03-10 13:30:35 Re: Relation ordering in FROM clause causing error related to missing entry... Or not.
Previous Message Michael Paquier 2015-03-10 13:05:57 Relation ordering in FROM clause causing error related to missing entry... Or not.