PHP-4.2.3 patch to allow restriction of database access

From: Jim Mercer <jim(at)reptiles(dot)org>
To: pgsql-general(at)postgreSQL(dot)org
Subject: PHP-4.2.3 patch to allow restriction of database access
Date: 2002-09-26 18:54:45
Message-ID: 20020926185445.GA39505@reptiles.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


the patch is at:
ftp://ftp.reptiles.org/pub/php/php-pgsql.patch

this patch adds the config variable pgsql.allowed_dblist

by default it has no value, meaning all databases are accessible

it can contain a colon delimited list of databases that are accessible.

if the database accessed is not in the list, and the list is not null,
then an error is returned as if the database did not exist

this patch is relative to php-4.2.3

this function would be very useful to apache/virtual hosting.

i have tested with the following in my apache httpd.conf:

<Directory /home/www/htdocs/jim>
php_admin_value pgsql.allowed_dblist "jim:billing"
</Directory>

although it can be accomplished by other means, setting the variable to a
value of ":" effectively locks the code out of pgsql.

also, a special tag of "-all-" will allow access to all databases.

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

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-09-26 20:00:48 Re: [HACKERS] Performance while loading data and indexing
Previous Message scott.marlowe 2002-09-26 18:41:55 Re: [HACKERS] Performance while loading data and indexing