Re: mod_auth_pgsql trouble

2010-11-30 Thread LEVAI Daniel
On Tue, Nov 30, 2010 at 12:56:32 +0100, Michael wrote:
 Hello,
 
 I am having trouble authenticating httpd users against a PostgreSQL
 database. Maybe someone here is using that module and can help me?
[...]

Check the pgsql logs for the actual query when trying to authenticate
(adjust postgresql.conf for more verbose logging if necessary). Execute
the same query in the psql shell, and see what it returns; check if it's
what you wanted.

The httpd.conf part seems ok to me, I'm using the same options, but
with encrytion and without the logging.
Also it may be easier to debug and to see through the situation if you
omit the currently irrelevant parts from you config, like the pgsql
logging.

Also you may want to check if the pgsql table/db's permissions allow the
access for the connecting pgsql role.


Daniel

-- 
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



Re: mod_auth_pgsql trouble (SOLVED)

2010-11-30 Thread Michael
Hello Daniel,

Am 30.11.2010 13:29, schrieb LEVAI Daniel:
 On Tue, Nov 30, 2010 at 12:56:32 +0100, Michael wrote:

 I am having trouble authenticating httpd users against a PostgreSQL
 database. Maybe someone here is using that module and can help me?
 [...]
 
 Check the pgsql logs for the actual query when trying to authenticate
 (adjust postgresql.conf for more verbose logging if necessary). Execute
 the same query in the psql shell, and see what it returns; check if it's
 what you wanted.
 
 The httpd.conf part seems ok to me, I'm using the same options, but
 with encrytion and without the logging.
 Also it may be easier to debug and to see through the situation if you
 omit the currently irrelevant parts from you config, like the pgsql
 logging.

Thanks a lot for your hint regarding the pgsql logs. After logging the
queries I could reproduce the problem using psql.

The query basically was:
select pass from table_name where user='name';

The problem here was the

where user='name'

part. When I used phpPgAdmin to generate that select it gave me

where user = 'name'

instead and that worked. So user seems to be some special name. After I
renamed the row to username it suddenly worked.

Really weird.

Is that a bug or a feature? Someone able to enlighten me? :-)

Thanks for your help!

Michael



Re: mod_auth_pgsql trouble (SOLVED)

2010-11-30 Thread Jason Dixon
On Tue, Nov 30, 2010 at 03:16:37PM +0100, Michael wrote:
 
 The problem here was the
 
 where user='name'
 
 part. When I used phpPgAdmin to generate that select it gave me
 
 where user = 'name'
 
 instead and that worked. So user seems to be some special name. After I
 renamed the row to username it suddenly worked.
 
 Really weird.
 
 Is that a bug or a feature? Someone able to enlighten me? :-)

USER is a SQL Key Word (reserved word) in PostgreSQL.

http://www.postgresql.org/docs/8.4/static/sql-keywords-appendix.html

-- 
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net/