Re: SECURITY LABEL on shared database object

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joe Conway <mail(at)joeconway(dot)com>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>, Kohei Kaigai <Kohei(dot)Kaigai(at)emea(dot)nec(dot)com>
Subject: Re: SECURITY LABEL on shared database object
Date: 2011-07-02 09:55:01
Message-ID: CADyhKSUphpDdYVp7Y6vJmmMGuC3tyKr6caSv80W5p1auHSFQJA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch re-defines pg_shseclabel.provider as NameData,
instead of Text,
and revert changes to catcache.c about collation.

Rest of parts are not changed.

Thanks,

2011/7/2 Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>:
> 2011/7/2 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp> writes:
>>> The origin of matter is, as you mentioned, collation to be used for system
>>> catalog scan when we reference it via syscache.
>>> So, the following chunk should be added, as I did in the userspace access
>>> vector patch - part.1.
>>
>>>   @@ -934,8 +935,7 @@ CatalogCacheInitializeCache(CatCache *cache)
>>>           /* Fill in sk_strategy as well --- always standard equality */
>>>           cache->cc_skey[i].sk_strategy = BTEqualStrategyNumber;
>>>           cache->cc_skey[i].sk_subtype = InvalidOid;
>>>   -       /* Currently, there are no catcaches on collation-aware data types */
>>>   -       cache->cc_skey[i].sk_collation = InvalidOid;
>>>   +       cache->cc_skey[i].sk_collation = DEFAULT_COLLATION_OID;
>>
>> I removed such a hunk from a previous patch of yours, and I don't like
>> it any better this time.  This is just a hack that will result in
>> masking bugs.
>>
>> Consider using a non-collation-aware datatype instead, such as NAME.
>>
> I agree that pg_(sh)seclabel.provider field shall not need more than
> NAMEDATALEN.
>
> How about re-define pg_seclabel.provider field also; currently defined as TEXT?
>
> Thanks,
> --
> KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
>
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

Attachment Content-Type Size
pgsql-v9.2-shared-security-label.v4.patch application/octet-stream 75.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2011-07-02 09:59:08 Re: [v9.1] sepgsql - userspace access vector cache
Previous Message Craig Ringer 2011-07-02 09:43:44 Visual Studio 2010/Windows SDK 7.1 support