ID:               40337
 Updated by:       [EMAIL PROTECTED]
 Reported By:      R_de__R at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         PostgreSQL related
 Operating System: Gentoo Linux
 PHP Version:      5.2.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Data inserted by other users cannot be read by an unprivileged user in
Postgres. Nothing to do with PHP in any case.


Previous Comments:
------------------------------------------------------------------------

[2007-02-03 00:27:54] R_de__R at hotmail dot com

Description:
------------
Hi,

I created a postgresql user and database and 2 tables and inserted some
data into the tables (with psql commandline). Made the postgresql user
OWNER of the database with the ability to create more databases but
WITHOUT user creation capabilities.
In php I could connect to the database could create more tables and get
the data out of the PHP created tables. But access was denied to the
tables I created with the psql commandline application!! When I gave
the postgresql user, postgresql user CREATION capabilities this went
away and I could access all the data .... Pretty WEIRD.

Hope you fix it soon for now I run with overpowered user,
DouweQuerty

Reproduce code:
---------------
<?php
$conn = pg_connect("host=localhost port=5432 user=some_user
dbname=some_database password=some_pass");

$sql = 'SELECT * from users';
$result = pg_query($conn,$sql);

echo "<table>\n";
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
   echo "\t<tr>\n";
   foreach ($line as $col_value) {
       echo "\t\t<td>$col_value</td>\n";
   }
   echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
pg_free_result($result);

// Closing connection
pg_close($conn);
?>

Expected result:
----------------
Full Access to the data in the database ... Eventhough they were
inserted by another aplication !

Actual result:
--------------
postgresql user WITHOUT postgresql user creation capabilities CAN'T
access data which was inserted by another application. But when the
postgresql user CAN make other postgresql users ALL data is accessable
(with no changes to php code or database settings...)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40337&edit=1

Reply via email to