Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > Re: [0/4] Propo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 27 Topic 9282 of 10966
Post > Topic >>

Re: [0/4] Proposal of SE-PostgreSQL patches

by kaigai@[EMAIL PROTECTED] (KaiGai Kohei) May 12, 2008 at 04:18 PM

Tom Lane wrote:
> KaiGai Kohei <kaigai@[EMAIL PROTECTED]
> writes:
>> Some of the test fails contains minor differences from expected
results, like:
> 
>> |   SELECT '' AS "xxx", *
>> |     FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a);
>> |    xxx | a | b |  c   | d
>> |   -----+---+---+------+---
>> |  -     | 0 |   | zero |
>> |        | 2 | 3 | two  | 2
>> |        | 4 | 1 | four | 2
>> |  +     | 0 |   | zero |
>> |   (3 rows)
> 
> Yeah, I remember those.  What needs to be looked at here is *why* the
> output is changing.  For a patch that allegedly does not touch the
> planner, it's fairly disturbing that you don't get the same results.

SE-PostgreSQL does not touch the planner, but it modifies given query
to filter violated tuples for the current user.
Thus, the above query is dealt as if the following query is inputed.

SELECT '' AS "xxx", *
  FROM J1_TBL t1 (a, b, c) NATURAL JOIN J2_TBL t2 (d, a)
  ON sepgsql_tuple_perms(t1.security_context, SEPGSQL_PERMS_SELECT, ...)
     and sepgsql_tuple_perms(t2.security_context, SEPGSQL_PERMS_SELECT,
...);

sepgsql_tuple_perms() returns true, if the security policy allows user
to access a given tuple. It returns false, if not so.

The result of EXPLAIN shows it more clearly:

| kaigai=# EXPLAIN SELECT '' AS "xxx", * FROM J1_TBL t1 (a, b, c) NATURAL
JOIN J2_TBL t2 (d, a);
|                                           QUERY PLAN
|
-----------------------------------------------------------------------------------------------
|  Hash Join  (cost=29023.54..82599.93 rows=1380 width=44)
|    Hash Cond: (t2.a = t1.a)
|    ->  Seq Scan on j2_tbl t2  (cost=0.00..53526.05 rows=713 width=8)
|          Filter: pg_catalog.sepgsql_tuple_perms(tableoid,
security_context, 12288, t2.*)
|    ->  Hash  (cost=29018.70..29018.70 rows=387 width=40)
|          ->  Seq Scan on j1_tbl t1  (cost=0.00..29018.70 rows=387
width=40)
|                Filter: pg_catalog.sepgsql_tuple_perms(tableoid,
security_context, 12288, t1.*)
| (7 rows)

>> and, some of them are trivial ones, like:
> 
>> |   SELECT p1.oid, p1.typname
>> |   FROM pg_type as p1
>> |   WHERE p1.typtype in ('b','e') AND p1.typname NOT LIKE E'\\_%' AND
NOT EXISTS
>> |       (SELECT 1 FROM pg_type as p2
>> |        WHERE p2.typname = ('_' || p1.typname)::name AND
>> |              p2.typelem = p1.oid and p1.typarray = p2.oid);
>> |  - oid | typname
>> |  ------+---------
>> |  - 210 | smgr
>> |  - 705 | unknown
>> |  -(2 rows)
>> |  + oid  |    typname
>> |  +------+----------------
>> |  +  210 | smgr
>> |  +  705 | unknown
>> |  + 3403 | security_label
>> |  +(3 rows)
> 
> Are you sure that the security_label type should not have an array type?
> I do not offhand see a good argument for that.  If it really shouldn't,
> we can change the expected output here, but you've got to make that
> case first.

Yes, security_label type should not have an array type.
It is defined with typelem=0 and typarray=0.
The purpose of this type is to represent the new system column of
security attribute ("security_context" column).

So, I think it is a case that a new expented output should be modified.

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@[EMAIL PROTECTED]
>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 27 Posts in Topic:
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-04-30 18:01:57 
Re: [0/4] Proposal of SE-PostgreSQL patches
josh@[EMAIL PROTECTED] (  2008-04-30 18:01:58 
Re: [0/4] Proposal of SE-PostgreSQL patches
jd@[EMAIL PROTECTED] (&q  2008-04-30 19:11:34 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-05 21:58:11 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-05 16:39:25 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-06 14:56:41 
Re: [0/4] Proposal of SE-PostgreSQL patches
ajs@[EMAIL PROTECTED] (A  2008-05-06 15:11:38 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-06 15:28:25 
Re: [0/4] Proposal of SE-PostgreSQL patches
ajs@[EMAIL PROTECTED] (A  2008-05-06 16:00:13 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-06 17:44:44 
Re: [0/4] Proposal of SE-PostgreSQL patches
josh@[EMAIL PROTECTED] (  2008-05-07 11:19:56 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-07 18:02:15 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-07 10:06:17 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-09 19:10:32 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-09 10:23:12 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-12 16:18:54 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-12 10:30:13 
Re: [0/4] Proposal of SE-PostgreSQL patches
andrew@[EMAIL PROTECTED]   2008-05-12 10:45:55 
Re: [0/4] Proposal of SE-PostgreSQL patches
tgl@[EMAIL PROTECTED] (T  2008-05-12 10:52:37 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-13 18:46:56 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-07 14:52:27 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-08 15:06:51 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-05-30 15:08:56 
Re: [0/4] Proposal of SE-PostgreSQL patches
bruce@[EMAIL PROTECTED]   2008-06-25 23:58:09 
Re: [0/4] Proposal of SE-PostgreSQL patches
josh@[EMAIL PROTECTED] (  2008-06-26 07:43:39 
Re: [0/4] Proposal of SE-PostgreSQL patches
kaigai@[EMAIL PROTECTED]   2008-06-27 00:32:32 
Re: [0/4] Proposal of SE-PostgreSQL patches
josh@[EMAIL PROTECTED] (  2008-06-26 09:29:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 12:19:03 CST 2008.