Re: hacker help: PHP-4.2.3 patch to allow restriction of database access - Mailing list pgsql-hackers

From Jim Mercer
Subject Re: hacker help: PHP-4.2.3 patch to allow restriction of database access
Date
Msg-id 20020927014954.GA52451@reptiles.org
Whole thread Raw
In response to Re: hacker help: PHP-4.2.3 patch to allow restriction of  (Gavin Sherry <swm@linuxworld.com.au>)
Responses Re: hacker help: PHP-4.2.3 patch to allow restriction of  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-hackers
On Fri, Sep 27, 2002 at 11:15:35AM +1000, Gavin Sherry wrote:
> On Thu, 26 Sep 2002, Jim Mercer wrote:
> > > I would think so, and IMHO, that's where pgsql access control
> > > belongs, with pgsql.
> 
> I totally disagree. It is a language level restriction, not a database
> level one, so why back it into Postgres? Just parse 'conninfo' when it is 
> pg_(p)connect() and check it against the configuration setting.

which is effectively what my code does, except i was lazy, and i let the
connection proceed, then check if PQdb() is in the auth list, and fail
if it isn't.  (i figured that way if there was any silliness in the conninfo
string, PQconnect would figure it out).

> The patch seems fine. I am unsure as to how useful it is.
> 
> system("/usr/local/pgsql/bin/psql -U jim -c \"select 'i got
>             in';\" template1");

that wouldn't work so well in safe_mode.  which is the area i'm playing with.

maybe not _totally_ secure, but much moreso than nothing.

and retricting virtual hosts to their own data sets relieves me of worry
about "GRANT all ON blah TO public;".

-- 
[ Jim Mercer        jim@reptiles.org         +1 416 410-5633 ]
[          I want to live forever, or die trying.            ]


pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: hacker help: PHP-4.2.3 patch to allow restriction of
Next
From: Gavin Sherry
Date:
Subject: Re: hacker help: PHP-4.2.3 patch to allow restriction of