Summary | horde not switching db correctly using horde sql session storage and mysql authentication with persistent connections |
Queue | Horde Base |
Queue Version | 3.1.7 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | chuck (at) horde (dot) org |
Requester | robb (at) wtg (dot) cw (dot) com |
Created | 05/02/2008 (6273 days ago) |
Due | |
Updated | 06/16/2008 (6228 days ago) |
Assigned | 06/13/2008 (6231 days ago) |
Resolved | 06/13/2008 (6231 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Many thanks,
Rob
Assigned to Chuck Hagenbuch
Taken from
State ⇒ Resolved
http://cvs.horde.org/diff.php/framework/SessionHandler/SessionHandler/mysql.php?r1=1.44&r2=1.45&ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?r1=1.1107&r2=1.1108&ty=u
State ⇒ Assigned
could have notice that from the many Init DB logs), so that's what we
should do in the session handler too.
whether is uses the same database as specified in the DB::connect()
call. But that's probably a bit too much magic. Instead it calls
mysql_connect() and uses the new_link parameter for that if specified.
This opens a whole can of worms though, because there could be a lot
of other places where we don't do all database operation sequentially.
But we can't simply request a new link in each SQL driver. That could
easily open a dozen connections per request.
existing connection without that parameter, though.
all DB::connect() calls, and we actually don't want them open new
connections.
that help?
mysql handle even though DB::connect is called with different
parameters than the current handle (as opened by the sessions handler).
State ⇒ Feedback
auth driver that would result in "SELECT name ...".
Either way, ugh. We call mysql_select_db when we open the connection
(or get back the persistent connection). We could call _open inside
_write, or just mysql_select_db, or we could force the use of
non-persistent connections. Thoughts?
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ horde not switching db correctly using horde sql session storage and mysql authentication with persistent connections
Type ⇒ Bug
Queue ⇒ Horde Base
$conf['auth']['params']['persistent'] = false;
$conf['auth']['params']['username'] = 'horde';
$conf['auth']['params']['password'] = '*****';
$conf['auth']['params']['hostspec'] = 'mysql';
$conf['auth']['params']['port'] = 3306;
$conf['auth']['params']['protocol'] = 'tcp';
$conf['auth']['params']['database'] = 'postfix';
$conf['auth']['params']['charset'] = 'iso-8859-1';
$conf['auth']['params']['phptype'] = 'mysql';
$conf['auth']['params']['driverconfig'] = 'custom';
$conf['auth']['params']['table'] = 'mailbox';
$conf['auth']['params']['username_field'] = 'username';
$conf['auth']['params']['password_field'] = 'password';
$conf['auth']['params']['encryption'] = 'crypt-md5';
$conf['auth']['params']['show_encryption'] = false;
$conf['auth']['driver'] = 'sql';
session config:
$conf['sessionhandler']['params']['persistent'] = true;
$conf['sessionhandler']['params']['rowlocking'] = true;
$conf['sessionhandler']['params']['port'] = 3306;
$conf['sessionhandler']['params']['protocol'] = 'tcp';
$conf['sessionhandler']['params']['hostspec'] = 'mysql';
$conf['sessionhandler']['params']['username'] = 'horde';
$conf['sessionhandler']['params']['password'] = '*****';
$conf['sessionhandler']['params']['database'] = 'horde';
$conf['sessionhandler']['type'] = 'mysql';
mysql query log shows:
080501 17:18:12 186 Connect horde@example.org on
186 Init DB horde
186 Query START TRANSACTION
186 Query SELECT session_data FROM
horde_sessionhandler WHERE session_id = '***************' AND
session_lastmodified > 1209657252 FOR UPDATE
186 Init DB postfix
186 Init DB postfix
186 Query SELECT name FROM mailbox WHERE username=''
186 Init DB postfix
186 Init DB postfix
186 Query SELECT name FROM mailbox WHERE username=''
186 Query DELETE FROM horde_sessionhandler
WHERE session_id = '***************'
186 Query ROLLBACK
186 Init DB postfix
186 Init DB postfix
186 Query SELECT name FROM mailbox WHERE username=''
186 Init DB postfix
186 Init DB postfix
186 Query SELECT name FROM mailbox WHERE username=''
186 Query REPLACE INTO horde_sessionhandler
(session_id, session_data
login fails with following logged by horde:
horde[22401]: [horde] Error writing session data: INSERT,DELETE
command denied to user 'horde'@'example.org' for table
'horde_sessionhandler' [on line 147 of
"/usr/share/horde/lib/Horde/SessionHandler/mysql.php"]
changing to non-persistent db connections fixes the issue