[sork] Passwd module/mysql

Kent Martin horde at kentsworld.com
Sat Feb 28 09:20:56 PST 2004


Hey folks,

I am trying to get the password module up and running, but cannot seem
to get it to match the user's existing password (it gives a you input
the wrong password type error message).

I have a mysql backend which holds the auth info for my imap server
(courier).

I can see the query coming through (which mysql debugging turned on) and
have run it manually - it is fine, it is just that passwd seems to thing
the output of that query doesn't match what I put in.  The same problem
occurs with clear and crypt so I have concentrated my efforts on getting
clear going. Don't worry about the update line, I am sure that won't be
a problem once I get the password matching working.

I am using the CVS cut from 27th Feb 2004.

Relevant table description:

mysql> describe users;
+---------+------------------+------+-----+---------+-------+
| Field   | Type             | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+-------+
| id      | varchar(128)     |      | MUL |         |       |
| crypt   | varchar(128)     |      |     |         |       |
| clear   | varchar(128)     |      |     |         |       |
| name    | varchar(128)     |      |     |         |       |
| uid     | int(10) unsigned |      |     | 65534   |       |
| gid     | int(10) unsigned |      |     | 65534   |       |
| home    | varchar(255)     |      |     |         |       |
| maildir | varchar(255)     |      |     |         |       |
| quota   | varchar(255)     |      |     |         |       |
| shell   | varchar(255)     |      |     |         |       |
+---------+------------------+------+-----+---------+-------+
10 rows in set (0.00 sec)

And finally, the relevant chunk of config:

 $backends['sql'] = array (
    'name' => 'Horde Authentication',
    'preferred' => '',
    'password policy' => array(
        'minLength' => 3,
        'maxLength' => 8,
        'maxSpace' => 0,
        'minUpper' => 0,
        'minLower' => 0,
        'minNumeric' => 0
    ),
    'driver' => 'sql',
    'params' => array(
        'phptype'    => 'mysql',
        'hostspec'   => 'localhost',
        'username'   => 'the authentication info is fine',
        'password'   => 'xxx',
        'encryption' => 'clear',
        'database'   => 'i can see the correct query hitting the
relevant database',
        'table'      => 'users',
        'user_col'   => 'id',
        'pass_col'   => 'clear',
        '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:
        //    %u -> gets substituted with the user
        //    %p -> gets substituted with the plaintext password
        //    %e -> gets substituted with the encrypted password
        //
        'query_lookup' => 'SELECT clear FROM users WHERE id = %u',
        //'query_lookup' => 'UPDATE users SET clear = %p, SET crypt = %e
WHERE id = %u',
        // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE
user_uid = %u',
        'query_modify' => 'UPDATE users SET clear = %p, SET crypt = %p
WHERE id
= %u'
        // 'query_modify' => 'UPDATE horde_users SET user_pass = %e
WHERE user_uid = %u',
    )
);

Regards,

Kent.



More information about the sork mailing list