RE: [PHP-DEV] PHP 4.0 Bug #5980: Informix ifx_connect reuses closed connection resource id

From: Date: Sun, 13 Aug 2000 00:26:22 +0000
Subject: RE: [PHP-DEV] PHP 4.0 Bug #5980: Informix ifx_connect reuses closed connection resource id
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-28733@lists.php.net to get a copy of this message
Hello Andrej, On 12-Aug-00 20:25:00, you wrote: >> >And why is this a problem for you? >> >> I discovered this problem when I was creating a database and then >creating >> its tables in the same script. Creating a database has to be done >by a DBA >> user. >Nope. All privileges info in Informix engines is stored in sys* >tables. No database, not special users. Everyone who can access the >engine can create database and become the owner. I did not mean on Informix side. Metabase database installation manager creates a database for you if want. Then it creates tables. Database creation is done by a user that is defined in Metabase Setup options for Informix that I specified by DBAUser. Tables are created by the Web user, so the DBAUser grants RESOURCE privileges to the Web user when the database is created. This is meant to have "some" security in the sense that if some body hacks your site grabbing the Web user password he won't be able to drop your database. Actually the DBAUser should only grant CONNECT privileges to prevent tables to be dropped, but I need first to move database table creation and dropping abstraction code to driver classes to be able to control things better at that level. This is not yet possible but it will be before the next public release. >> The tables and other objects of the database can be created by any >> user. >Ooops, nope again. They can be create by DBA and RESOURCE privileged >users. I think not everything can be done by RESOURCE. Yes, I meant that you specify in Metabase Setup options which user should be granted access to create the tables but it could be anyone including the same specified as DBAUser . >> When I used the same user for both things the connection was reused >> but since I was closing and reopening it >"it"? You are closing and reopening connection from PHP to Informix. Yes, Metabase Informix driver checks if server, user or password are different between two queries, the current connection is closed and a new connection is established. >> I encountered the problem. >But you did not answer why is it a problem for you? I did not see this >as a problem situation, so far? Because Informix does not let you open more then one connection through shared memory. >> This problem is still a bug in PHP that needs to be fixed but I am >avoiding >> it by not closing the connection when the server, database, user and >> password are the same. So this won't affect PHP Metabase driver >unless you >> use more than one Metabase database connection setups which is not >usual >> and it is not the way Metabase manager class works. >Still confused... What I mean here is that this is only a problem when you are using different users to connect to the same Informix server in the same script, which only happens when DBAUser is different from Web user when you are creating up a new database using Metabase installation manager. When you are already using Metabase in Web applications you only use one connection that is established for the Web user so this is not a problem. Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --

« previous php.dev (#28733) next »