6.0.0-alpha14
7/2/25

[#10963] problem with PostgreSQL
Summary problem with PostgreSQL
Queue Passwd
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners ralf.lang (at) ralf-lang (dot) de
Requester gosho (at) oles (dot) biz
Created 02/06/2012 (4895 days ago)
Due
Updated 02/07/2012 (4894 days ago)
Assigned 02/06/2012 (4895 days ago)
Resolved 02/07/2012 (4894 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/07/2012 12:24:34 PM Git Commit Comment #8 Reply to this comment
Changes have been made in Git (develop):

commit 7fdb5611e3b3bb3d38e09d1448906eb678ada66a
Author: Jan Schneider <jan@horde.org>
Date:   Tue Feb 7 13:06:14 2012 +0100

     Simplify, blacklist (Bug #10963).

  passwd/lib/Factory/Driver.php |   29 +++++++++++------------------
  1 files changed, 11 insertions(+), 18 deletions(-)

http://git.horde.org/horde-git/-/commit/7fdb5611e3b3bb3d38e09d1448906eb678ada66a
02/07/2012 12:08:03 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (master):

commit 7fdb5611e3b3bb3d38e09d1448906eb678ada66a
Author: Jan Schneider <jan@horde.org>
Date:   Tue Feb 7 13:06:14 2012 +0100

     Simplify, blacklist (Bug #10963).

  passwd/lib/Factory/Driver.php |   29 +++++++++++------------------
  1 files changed, 11 insertions(+), 18 deletions(-)

http://git.horde.org/horde-git/-/commit/7fdb5611e3b3bb3d38e09d1448906eb678ada66a
02/07/2012 06:21:47 AM Ralf Lang Comment #6
State ⇒ Resolved
Reply to this comment
Thank you for the testing & fixes.
02/06/2012 11:03:52 PM Git Commit Comment #5 Reply to this comment
Changes have been made in Git (develop):

commit a4aa1f00f0b6423fb8f5c00977a47932e3271bc2
Author: Ralf Lang <lang@b1-systems.de>
Date:   Mon Feb 6 19:33:20 2012 +0000

     [rla] Don't pass too many parameters from backends.php to 
Horde_Db (Fix for [#10963] problem with PostgreSQL)

  passwd/docs/CHANGES |    2 ++
  passwd/package.xml  |    2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)

http://git.horde.org/horde-git/-/commit/a4aa1f00f0b6423fb8f5c00977a47932e3271bc2
02/06/2012 10:48:52 PM gosho (at) oles (dot) biz Comment #4
New Attachment: Driver.php.patch Download
Reply to this comment

[Show Quoted Text - 9 lines]
Hi Ralf
I made a little modification on your patch and it works for me (look 
at attached diff). Thank you for your fast response.
02/06/2012 07:38:21 PM Ralf Lang Comment #3
Version ⇒ Git master
State ⇒ Feedback
Assigned to Ralf Lang
Reply to this comment
I see the problem, postgresql complains about all parameters from 
backends.php being passed. I have reproduced this and provided a fix. 
This works for me, but please give feedback:

Are you still experiencing problems when you replace your 
passwd/lib/Factory/Driver.php file with
this version 
https://raw.github.com/horde/horde/a4aa1f00f0b6423fb8f5c00977a47932e3271bc2/passwd/lib/Factory/Driver.php   
?
02/06/2012 07:33:42 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit a4aa1f00f0b6423fb8f5c00977a47932e3271bc2
Author: Ralf Lang <lang@b1-systems.de>
Date:   Mon Feb 6 19:33:20 2012 +0000

     [rla] Don't pass too many parameters from backends.php to 
Horde_Db (Fix for [#10963] problem with PostgreSQL)

  passwd/docs/CHANGES |    2 ++
  passwd/package.xml  |    2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)

http://git.horde.org/horde-git/-/commit/a4aa1f00f0b6423fb8f5c00977a47932e3271bc2
02/06/2012 10:00:35 AM gosho (at) oles (dot) biz Comment #1
Milestone ⇒
State ⇒ Unconfirmed
Patch ⇒ No
Queue ⇒ Passwd
Summary ⇒ problem with PostgreSQL
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Hi.

I tried to configure Passwd 4.0 with PostfixAdmin on PostgreSQL, but 
without success.
My environment is Debian 6 (Squeeze) AMD64, PHP 5.3.3, PostgreSQL 8.4. 
pear - from the distribution.

The Passwd message when I try to change my password is "Password 
module is not properly configured" and the error in syslog is :

  HORDE: [passwd] Could not instantiate PDO with DSN 
"pgsql:port=5432;encryption=plain;table=mailbox;user_col=username;pass_col=password;query_lookup=SELECT password FROM mailbox WHERE username = %u and active = 1;query_modify=UPDATE mailbox SET password = %p WHERE username = %u;host=127.0.0.1;dbname=postfix".  PDOException: SQLSTATE[08006] [7] invalid connection option "encryption" [pid 24188 on line 100 of 
"/var/www/horde4/passwd/lib/Factory/Driver.php"]

My backends.php is:

$backends['postfixadmin'] = array (
     'disabled' => false,
     'name' => 'Postfix Admin server',
     'preferred' => '',
     'policy' => array(
         'minLength' => 6,
         'maxLength' => 20,
         'minNumeric' => 1,
     ),
     'driver' => 'Sql',
     'params' => array(
         'phptype' => 'pgsql',
         'hostspec' => '127.0.0.1',
         'protocol'   => 'tcp',
         'port'  => '5432',
         'charset' => 'utf-8',
         'username' => 'postfix',
         'password' => 'password',
         'database' => 'postfix',
         'encryption' => 'plain',
         'table' => 'mailbox',
         'user_col' => 'username',
         'pass_col' => 'password',
         'show_encryption' => false,
         // The following two settings allow you to specify custom queries for
         // lookup and modify functions if special functions need to be
         // performed.  In places where a username or a password needs to be
         // used, refer to this placeholder reference:
         //    %d -> gets substituted with the domain
         //    %u -> gets substituted with the user
         //    %U -> gets substituted with the user without a domain part
         //    %p -> gets substituted with the plaintext password
         //    %e -> gets substituted with the encrypted password
         //
         'query_lookup' => 'SELECT password FROM mailbox WHERE 
username = %u and active = 1',
         'query_modify' => 'UPDATE mailbox SET password = %p WHERE 
username = %u'
     )
);

Saved Queries