Re: patch for type privileges - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: patch for type privileges
Date
Msg-id 1323284349.27491.0.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: patch for type privileges  (Yeb Havinga <yebhavinga@gmail.com>)
Responses Re: patch for type privileges  (Yeb Havinga <yebhavinga@gmail.com>)
List pgsql-hackers
On fre, 2011-12-02 at 17:11 +0100, Yeb Havinga wrote:
> Using a cast, it is possible to create a table with a code path through
> OpenIntoRel:
>
> session 1:
> t=# revoke all on type int2 from public;
> session2 :
> t=> create table t2 (a int2);
> ERROR:  permission denied for type smallint
> t=> create table t as (select 1::int2 as a);
> SELECT 1
> t=> \d t
>         Table "public.t"
>   Column |   Type   | Modifiers
> --------+----------+-----------
>   a      | smallint |
>
> t=>
>
> Something different: as non superuser I get this error when restricting
> a type I don't own:
>
> t=> revoke all on type int2 from public;
> ERROR:  unrecognized objkind: 6

Two excellent finds.  Here is an updated patch with fixes.

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [v9.2] Fix Leaky View Problem
Next
From: Robert Haas
Date:
Subject: Re: [v9.2] Fix Leaky View Problem