Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0D3926325F2 for ; Thu, 15 Oct 2009 14:22:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 83234-03 for ; Thu, 15 Oct 2009 17:22:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 980A2632299 for ; Thu, 15 Oct 2009 14:22:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n9FHM2Sd010496; Thu, 15 Oct 2009 13:22:02 -0400 (EDT) To: KaiGai Kohei cc: Stephen Frost , robertmhaas@gmail.com, pgsql-hackers@postgresql.org, kaigai@kaigai.gr.jp Subject: Re: Reworks for Access Control facilities (r2363) In-reply-to: <4AD54082.9050001@ak.jp.nec.com> References: <4AC5A14F.6050306@ak.jp.nec.com> <20091012024604.GW17756@tamriel.snowman.net> <4AD54082.9050001@ak.jp.nec.com> Comments: In-reply-to KaiGai Kohei message dated "Wed, 14 Oct 2009 12:07:46 +0900" Date: Thu, 15 Oct 2009 13:22:02 -0400 Message-ID: <10495.1255627322@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.576 tagged_above=-10 required=5 tests=AWL=0.023, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/902 X-Sequence-Number: 147714 KaiGai Kohei writes: > [ patch r2363 ] I promised I would review this today, but I just can't make myself do it in any detail. This is too large, too ugly, and it is going in a direction that I do not like or want to spend any of my time on. The overwhelming impression after a brief read-through is that the code has been hacked apart with a chainsaw and reassembled into a Frankenstein's monster --- it's alive, but man is it ugly. Code comments that refer to something "above" or "below" are still there, but the referent is no longer close enough for that to be a reasonable way of referring to it. It's impossible to follow what's going on or why, either in the shim functions or in the callers --- in the original coding there was context for the aclcheck calls, now there isn't. I don't have any confidence that this is a sane way to proceed forward. The shim layer knows everything about everything --- there may still be a few backend .h files it doesn't include, but that's not for lack of trying. The direction this is heading in is an unmaintainable giant-bowl-of-spaghetti security module, rather than something that can be divided into understandable parts. And I don't think it's really removed any complexity from the callers, nor do I believe that it's going to be a useful basis for imposing a different security policy than the one we have now. Two specific examples of why not: * The "skip permissions checks" arguments that have been added to various random functions suggest strongly that the factoring still isn't right --- I especially don't believe in that in the context of performDeletion and friends. * There are two special-purpose shims, ac_database_calculate_size and ac_tablespace_calculate_size, that got added for the benefit of utils/adt/dbsize.c. What if that code were still in contrib? How is it different from a lot of the code that is in contrib now, eg dblink or pgrowlocks, to say nothing of third-party modules? Presuming that the shim layer can know explicitly about each individual permission-checking requirement is a dead-end design. Maybe if I weren't burned out after a month of CommitFesting, I could muster a more positive reaction, but right now I just can't summon any enthusiasm for this. regards, tom lane