From:             R_de__R at hotmail dot com
Operating system: Gentoo Linux
PHP version:      5.2.0
PHP Bug Type:     PostgreSQL related
Bug description:  Data inserted by other application NOT ACCESSABLE

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 bug report at http://bugs.php.net/?id=40337&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40337&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40337&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40337&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40337&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40337&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40337&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40337&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40337&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40337&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40337&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40337&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40337&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40337&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40337&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40337&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40337&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40337&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40337&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40337&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40337&r=mysqlcfg

Reply via email to