6.0.0-git
2021-01-18

[#9879] Horde authentification: SQL Custom
Summary Horde authentification: SQL Custom
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners mrubinsk (at) horde (dot) org
Requester torben (at) dannhauer (dot) info
Created 2011-04-11 (3570 days ago)
Due
Updated 2011-04-14 (3567 days ago)
Assigned 2011-04-13 (3568 days ago)
Resolved 2011-04-14 (3567 days ago)
Milestone
Patch No

History
2011-04-14 13:14:08 torben (at) dannhauer (dot) info Comment #11 Reply to this comment
Hi Michael,

sorry, wrong alarm, it seems also to work with socket if I do not 
specify the path to the socket.

thanks a lot!

Torben

2011-04-14 06:25:00 torben (at) dannhauer (dot) info Comment #10 Reply to this comment
Hi Michael,

I copied this files into my pear installation:
- framework/Auth/lib/Horde/Auth/Cyrsql.php
- framework/Auth/lib/Horde/Auth/Imap.php
- framework/Core/lib/Horde/Core/Auth/Signup/Sql.php
- framework/Core/lib/Horde/Core/Factory/Auth.php
- framework/Core/lib/Horde/Core/Factory/Db.php

with postgreSQL and TCP/IP (localhost) it works, with postgreSQL and 
unix_socket it does not work.

The error is similar to the error you fixed for me:

Could not instantiate PDO with DSN 
"pgsql:host=localhost;dbname=my_db;unix_socket=/var/run/postgresql/". 
PDOException: SQLSTATE[08006] [7] ungültige Verbindungsoption (means: 
invalid option) »unix_socket«

Questions: Why is localhost there mentioned? Its socket, not tcp/ip. 
and pgsql doesn't like 'unix_socket' it seems :)

Maybe your have to apply your changes also for pgsql via socket?

Thank you for your help!

Torben
2011-04-14 06:03:05 torben (at) dannhauer (dot) info Comment #9 Reply to this comment
Did you generate your config through the interface? It seems to 
contain fields that are generated when using the cyrus sql driver, 
not the custom sql driver as you said you used.

Regardless, I reverted the previous commit and committed a more 
appropriate fix. Should be fixed now.
I genereted it througbh the web interface. I selected custom and in 
the sub-seletion PostgreSQL.
'Ill test it.

What files are affected?

thanks anyway!

Torben
2011-04-14 02:56:55 Michael Rubinsky Comment #8
State ⇒ Resolved
Reply to this comment
Did you generate your config through the interface? It seems to 
contain fields that are generated when using the cyrus sql driver, not 
the custom sql driver as you said you used.

Regardless, I reverted the previous commit and committed a more 
appropriate fix. Should be fixed now.
2011-04-14 02:53:30 Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Bug: 9879 - More fields to sanitize for custom sql auth drivers

  1 files changed, 6 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/6b93dd448cd446adefac3bd21875af5f084eb734
2011-04-13 13:45:37 Michael Rubinsky State ⇒ Assigned
 
2011-04-13 13:45:05 Michael Rubinsky Comment #6 Reply to this comment
Maybe Horde creates the config file in a wrong way?
No. The config is fine. I know what's wrong, though I won't have 
access to my source tree until later tonight.
2011-04-13 06:24:06 torben (at) dannhauer (dot) info Comment #5 Reply to this comment

[Show Quoted Text - 10 lines]
Maybe Horde creates the config file in a wrong way?

my auth part of horde/config/conf.php is:

$conf['auth']['admins'] = array('Administrator', 'user@domain.tld');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['list_users'] = 'input';
$conf['auth']['params']['persistent'] = true;
$conf['auth']['params']['username'] = 'db_user';
$conf['auth']['params']['password'] = 'db_pass';
$conf['auth']['params']['hostspec'] = 'localhost';
$conf['auth']['params']['protocol'] = 'tcp';
$conf['auth']['params']['database'] = 'non_horde_auth_db';
$conf['auth']['params']['charset'] = 'utf-8';
$conf['auth']['params']['phptype'] = 'pgsql';
$conf['auth']['params']['driverconfig'] = 'custom';
$conf['auth']['params']['table'] = 'auth_table;
$conf['auth']['params']['username_field'] = 'user_field';
$conf['auth']['params']['password_field'] = 'pw_field';
$conf['auth']['params']['encryption'] = 'crypt-md5';
$conf['auth']['params']['show_encryption'] = false;
$conf['auth']['driver'] = 'sql';


2011-04-13 06:17:04 torben (at) dannhauer (dot) info Comment #4 Reply to this comment
Does this fix things?
No, it's still the same DSN error.

I only copied your modified file from the git repo into the horde 
installation of the pear package.

do I need other files to update?

Thanks, Torben
2011-04-13 05:07:06 Michael Rubinsky Comment #3
Assigned to Michael Rubinsky
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
Does this fix things?
2011-04-13 05:06:35 Git Commit Comment #2 Reply to this comment
Changes have been made in Git for this ticket:

sanitize the parameters used to instantiate a Horde_Db_Adapter
Possibly fixes Bug: 9879

  1 files changed, 14 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/e457307312c03f50d0b2dc9f2c13bf22673c4ca3
2011-04-11 19:29:56 torben (at) dannhauer (dot) info Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ Horde authentification: SQL Custom
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
Dear Dev Team,

Switching the Horde authentication from IMAP to SQL with custom 
settings, the PDO instantation crashed. The Pdo seems to have problems 
with the connection parameters, maybe some kind of mis-parsing...

Details:
Horde H4.
Horde SQL Auth -> Custom -> pgsql (PostgreSQL 9.0, PHP Version 5.3.3-7)

Error Message:
Could not instantiate PDO with DSN 
"pgsql:driverconfig=custom;table=my_user_table;username_field=_my_user_name;password_field=_my_user_password;host=localhost;dbname=other_than_horde_db". PDOException: SQLSTATE[08006] [7] ungültige Verbindungsoption(means: invalid connection option) 
»driverconfig«

callstack:
  1. Horde_Registry::appInit() 
/usr/share/php/www/horde/admin/config/config.php:12
  2. Horde_Registry->__construct() /usr/share/php/Horde/Registry.php:231
  3. Horde_Injector->getInstance() /usr/share/php/Horde/Registry.php:440
  4. Horde_Injector->createInstance() /usr/share/php/Horde/Injector.php:248
  5. Horde_Injector_Binder_Factory->create() 
/usr/share/php/Horde/Injector.php:213
  6. Horde_Core_Factory_Notification->create() 
/usr/share/php/Horde/Injector/Binder/Factory.php:111
  7. Horde_Registry->listApps() 
/usr/share/php/Horde/Core/Factory/Notification.php:20
  8. Horde_Registry->hasPermission() /usr/share/php/Horde/Registry.php:781
  9. Horde_Registry->isAuthenticated() /usr/share/php/Horde/Registry.php:1399
10. Horde_Registry->checkExistingAuth() /usr/share/php/Horde/Registry.php:1823
11. Horde_Core_Factory_Auth->create() /usr/share/php/Horde/Registry.php:2191
12. Horde_Core_Factory_Auth->_create() 
/usr/share/php/Horde/Core/Factory/Auth.php:61
13. Horde_Core_Factory_Db->create() 
/usr/share/php/Horde/Core/Factory/Auth.php:183
14. Horde_Core_Factory_Db->createDb() 
/usr/share/php/Horde/Core/Factory/Db.php:88
15. Horde_Db_Adapter_Base->__construct() 
/usr/share/php/Horde/Core/Factory/Db.php:151
16. Horde_Db_Adapter_Pdo_Pgsql->connect() 
/usr/share/php/Horde/Db/Adapter/Base.php:143
17. Horde_Db_Adapter_Pdo_Base->connect() 
/usr/share/php/Horde/Db/Adapter/Pdo/Pgsql.php:88




Saved Queries