httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Donovan <donov...@bellatlantic.net>
Subject Re: [users@httpd] Re: Error trying to use 'mod_auth_form' and 'mod_dbd' with sqlite3
Date Thu, 27 Apr 2017 23:16:24 GMT
On 04/26/2017 06:49 AM, Tom Browder wrote:
> On Wed, Apr 26, 2017 at 05:06 Tom Browder <tom.browder@gmail.com <mailto:tom.browder@gmail.com>>
wrote:
>
>     On Wed, Apr 26, 2017 at 04:04 Luca Toscano <toscano.luca@gmail.com
>     <mailto:toscano.luca@gmail.com>> wrote:
>
>             > I think I just discovered I what the problem is: I'm using harp.js to
>             > build my site and the <form...> is compiling incorrectly.
>
>             Well, that wasn't the problem.
>
>             The error is still:
>
>             [dbd:error] [pid 18921:tid 140512673658624] (20014)Internal error:
>             Â  AH00632: failed to prepare SQL statements: near "authn_query": syntax
error
>
>
> I have no clue as to why dbd isn'initializing. Untill someone can tell me exactly how
to get it
> working, I'm going to try the file method. Bummer!
>
> -Tom

I am able to reproduce your error, and it does seem to be a bug in mod_dbd when prepared statements

are used inside <Directory> blocks for authentication.

Instead of using DBDPrepareSQL to create a prepared statement, please try removing the DBDPrepareSQL

line entirely and put your SQL statement directly in your AuthDBDUserPWQuery directive, like
this:

      AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s"

Note that Luca's advice was correct:  no single-quotes around the %s, and no terminating semicolon

should be used in the SQL for httpd configuration directives, even though you would use them
in 
interactive sqlite3 SQL commands.

There should be no performance penalty for doing it this way.  AuthDBDUserPWQuery automatically

generates prepared statements.  Your original directives seem reasonable per the current 
documentation, so it's a bug - although I'm not sure (yet) if it's a doc bug or a code bug.

-tom-





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message