Skip site navigation (1) Skip section navigation (2)

Re: SECURITY LABEL on shared database object

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "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-06-30 03:47:40
Message-ID: BANLkTi=y8A7prNS6G2DhrihL6+1aQdpCZw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Thanks for your reviewing, and Sorry for this debugging burden.

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.

The attached patch is fixed version.

  @@ -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;

          CACHE4_elog(DEBUG2, "CatalogCacheInitializeCache %s %d %p",
                      cache->cc_relname,

Thanks,

2011/6/30 Joe Conway <mail(at)joeconway(dot)com>:
> I signed up to do a review on $subject patch for the commitfest. In
> order to do that, I want to get SELinux and contrib/sepgsql properly set
> up so that I can test. I ran into a problem when trying to do:
>
>    cd contrib/sepgsql
>    make install                       (succeeds)
>    make installcheck                  (fails)
>
> I get this:
>
>    ============== creating database "contrib_regression" ==============
>    ERROR:  could not determine which collation to use for string
>    comparison
>    HINT:  Use the COLLATE clause to set the collation explicitly.
>    command failed: "/usr/local/pgsql-head/bin/psql" -X -c "CREATE
>    DATABASE \"contrib_regression\" TEMPLATE=template0" "postgres"
>    make: *** [installcheck] Error 2
>
> So I installed sepgsql into the postgres database anyway and do this:
>
>    postgres=# SELECT sepgsql_restorecon(NULL);
>    ERROR:  could not determine which collation to use for string
>    comparison
>    HINT:  Use the COLLATE clause to set the collation explicitly.
>
> Ok, so now I go look at the docs to figure out what exactly a "COLLATE
> clause" is. Only searching the online docs brings up no hits on the
> keyword COLLATE". Google brings me to TODO wiki page:
>
>    http://wiki.postgresql.org/wiki/Todo:Collate
>
> But that isn't much help either. Grepping the source gets hits in 9.1
> and master. So I guess:
>
> 1) COLLATE clause is a new feature in 9.1?
> 2) The doc search feature on postgresql.org does not search the 9.1
>   documentation?
>
> I looked in the 9.1 docs in SQL Commands->SELECT and could find no
> reference to COLLATE. Can anyone point me to some documentation that
> would explain what that error message means and how to resolve it?
>
> Thanks,
>
> Joe
>
> --
> Joe Conway
> credativ LLC: http://www.credativ.us
> Linux, PostgreSQL, and general Open Source
> Training, Service, Consulting, & 24x7 Support
>
>



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

Attachment: pgsql-v9.2-shared-security-label.v3.patch
Description: application/octet-stream (76.1 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Fujii MasaoDate: 2011-06-30 03:58:50
Subject: Re: Online base backup from the hot-standby
Previous:From: Fujii MasaoDate: 2011-06-30 03:27:59
Subject: Re: time-delayed standbys

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group