Dear Experts,
I am trying to track down a broken postgresql authn issue which I have
described here:
http://marc.info/?l=apache-httpd-users&m=118765132424174&w=2
My guess is that I'm encountering the known issues with DBD described here:
http://marc.info/?l=apache-httpd-dev&m=116742014418304&w=2
Am I right in thinking that this is fixed in the trunk but not in
2.2.4? What about 2.2.5/6 - I don't see anything in the 2.2.5 changelog.
Anyway, I have been looking at the source, and a few issues thoughts
have occurred to me:
- In mod_authn_dbd.c, a couple of global variables are used to point to
the dbd_acquire and dbd_prepare functions. Am I right in thinking that
this means you can have only one dbd driver for authn? So you can't
for example, have postgresql in one virtual host and mysql in another?
(Is this already a limitation of dbd?) This isn't a problem for me,
unless these variables get set to NULL by a virtual host with no
DBDriver directive. Maybe DBDriver should only appear in the global
configuration? Is it certain that these variables are set before the
server first forks?
- It looks as if, when a new db connection is created, all prepared
statements are prepared on the new connection. However, when a new
prepared statement is created, it is not prepared on any existing
connections. This is fine as long as all prepared statements are
declared before any connections are established. Correct?
- authn_dbd_password() uses the error message "Error looking up %s in
database" for 3 different errors. It would be really great to have
different messages in each case.
- The mod_authn_dbd docs
(http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html) claim "DBD
drivers recognise both stdio-like %s and native syntax". Is this
accurate? It seems that the postgresql DBD driver does some type magic
based on the character after the %, which wouldn't be possible with the
postgresql $1 syntax. Maybe $1 only works for strings (which would be
OK for usernames, of course). (Does it correctly count the number of
parameters if I use $1?)
- The mod_dbd docs (http://httpd.apache.org/docs/2.2/mod/mod_dbd.html)
say that DBDPersist can be 0 or 1; this should be on or off.
Many thanks for any feedback. If the answer is "this is fixed in
2.2.6", and that's due soon, I'll just wait.
Regards,
Phil.