Bug#680993: libaprutil1-dbd-mysql: AuthDBDUserPWQuery (Module mod_dbd.c) for MySQL doesn't allow SQL statement with a stored procedure

2012-09-11 Thread Pierre-Gilles RAYNAUD
Hi Stephan,

Thank you for your support and I'm sorry for my delayed answer.
Here are the result I'm getting

MySQL
mysql.log
 21029 Connectmail-usr@localhost on Mail
 21029 Preparecall GetApacheAuth( ? )

Apache
error.log
[Wed Sep 12 07:16:32 2012] [error] [client 192.168.2.240] Query
execution error looking up 'test.example' in database: PROCEDURE
Mail.GetApacheAuth can't return a result set in the given context

So message error in the log file is more explicit at this time.

Cheers
--
Pierre-Gilles


On 22/07/12 10:23, Stefan Fritsch wrote:
 On Monday 09 July 2012, pgr.sikkin wrote:
 The apache log
 [Mon Jul 09 20:22:57 2012] [error] [client 192.168.2.241] Query
 execution error looking up 'test.example' in database

 Can you try the attached patch and see if it gives you a better error 
 message in the log? Alternatively, I have put the mod_authn_dbd.so 
 compiled for i386 here:

 http://people.debian.org/~sf/680993/mod_authn_dbd.so

 $ sha256sum mod_authn_dbd.so
 88ee23e8f0cb1b6d775babc86be55300c2517228dab035a60f1a06439c062b61  
 mod_authn_dbd.so

 Cheers,
 Stefan


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#680993: libaprutil1-dbd-mysql: AuthDBDUserPWQuery (Module mod_dbd.c) for MySQL doesn't allow SQL statement with a stored procedure

2012-07-22 Thread Stefan Fritsch
On Monday 09 July 2012, pgr.sikkin wrote:
 
 The apache log
 [Mon Jul 09 20:22:57 2012] [error] [client 192.168.2.241] Query
 execution error looking up 'test.example' in database
 

Can you try the attached patch and see if it gives you a better error 
message in the log? Alternatively, I have put the mod_authn_dbd.so 
compiled for i386 here:

http://people.debian.org/~sf/680993/mod_authn_dbd.so

$ sha256sum mod_authn_dbd.so
88ee23e8f0cb1b6d775babc86be55300c2517228dab035a60f1a06439c062b61  
mod_authn_dbd.so

Cheers,
Stefan
diff --git a/modules/aaa/mod_authn_dbd.c b/modules/aaa/mod_authn_dbd.c
index 3341171..2ee7a44 100644
--- a/modules/aaa/mod_authn_dbd.c
+++ b/modules/aaa/mod_authn_dbd.c
@@ -92,6 +92,7 @@ static authn_status authn_dbd_password(request_rec *r, const char *user,
 apr_dbd_prepared_t *statement;
 apr_dbd_results_t *res = NULL;
 apr_dbd_row_t *row = NULL;
+int ret;
 
 authn_dbd_conf *conf = ap_get_module_config(r-per_dir_config,
 authn_dbd_module);
@@ -116,11 +117,12 @@ static authn_status authn_dbd_password(request_rec *r, const char *user,
   AuthDBDUserPWQuery with the key '%s', conf-user);
 return AUTH_GENERAL_ERROR;
 }
-if (apr_dbd_pvselect(dbd-driver, r-pool, dbd-handle, res, statement,
-  0, user, NULL) != 0) {
+if ((ret = apr_dbd_pvselect(dbd-driver, r-pool, dbd-handle, res,
+statement, 0, user, NULL)) != 0) {
 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
   Query execution error looking up '%s' 
-  in database, user);
+  in database: %s,
+  user, apr_dbd_error(dbd-driver, dbd-handle, ret));
 return AUTH_GENERAL_ERROR;
 }
 for (rv = apr_dbd_get_row(dbd-driver, r-pool, res, row, -1);


signature.asc
Description: This is a digitally signed message part.


Bug#680993: libaprutil1-dbd-mysql: AuthDBDUserPWQuery (Module mod_dbd.c) for MySQL doesn't allow SQL statement with a stored procedure

2012-07-09 Thread pgr.sikkin
Package: libaprutil1-dbd-mysql
Version: 1.3.9+dfsg-5
Severity: important

IfModule mod_gnutls.c
  VirtualHost 192.168.1.52:
 ServerAdmin   webmas...@cwexample.net
 ServerNamedav.example.net:

 WSGIDaemonProcess radicale user=calendar group=www-data threads=1
 WSGIScriptAlias   / /home/www-data/calendar/radicale.wsgi

 Alias /favicon.ico /home/www-data/calendar/favicon.ico

 Directory /home/www-data/calendar/
WSGIProcessGroup  radicale
WSGIApplicationGroup  %{GLOBAL}

AuthType Basic
AuthName DAV (CadDAV  CardDav) Authentication

IfModule !mod_dbd.c
   #  with
   AuthBasicProviderfile
   AuthUserFile /etc/radicale/radicale.passwd
/IfModule

IfModule mod_dbd.c
   # with mod_authn_dbd
   AuthBasicProvider  dbd
   AuthDBDUserPWQuery SEE BELOW THE TWO SQL STATEMENT
/IfModule

Require  valid-user

AllowOverrideNone
 /Directory

 # Possible values include: debug, info, notice, warn, error, crit, alert, 
emerg.
 LogLevel  warn
 ErrorLog  /home/www-logs/error.log
 CustomLog /home/www-logs/access-ssl-dav.log combined

 #
 # Https config
 #
 GnuTLSEnable  on
 # « Normal » permet à GnuTLS d’utiliser les algotithmes standard AES, 
3DES, ARCFOUR et CAMELLIA
 GnuTLSPriorities  Normal
 GnuTLSCacheTimeout500
 GnuTLSExportCertificates  on
 #GnuTLSClientVerifyrequest
 GnuTLSClientCAFile/path/to/example.crt

 GnuTLSCertificateFile /path/to/dav.crt
 GnuTLSKeyFile /path/to/example.pem

  /VirtualHos
/IfModule


with the following directive 
AuthDBDUserRealmQuery  SELECT Password From Test Where User = %s

the MySQL log show
120709 19:23:38   240 Connect   mail-usr@localhost on Mail
  241 Connect   mail-usr@localhost on Mail
  242 Connect   mail-usr@localhost on Mail
  240 Prepare   SELECT Password From Test Where User = ?
  241 Prepare   SELECT Password From Test Where User = ?
  242 Prepare   SELECT Password From Test Where User = ?
  243 Connect   mail-usr@localhost on Mail
  244 Connect   mail-usr@localhost on Mail
  243 Prepare   SELECT Password From Test Where User = ?
  244 Prepare   SELECT Password From Test Where User = ?
  245 Prepare   SELECT Password From Test Where User = ?
120709 19:24:17   242 Execute   SELECT Password From Test Where User = 
'test.example'
  247 Connect   mail-usr@localhost on Mail
  246 Connect   mail-usr@localhost on Mail
  246 Prepare   SELECT Password From Test Where User = ?
  247 Prepare   SELECT Password From Test Where User = ?
and we get authorization.


with the following directive
  AuthDBDUserPWQuery call GetApacheAuth( %s )

the MySQL log  are
120709 20:32:56   337 Connect   mail-usr@localhost on Mail
  338 Connect   mail-usr@localhost on Mail
  339 Connect   mail-usr@localhost on Mail
  340 Connect   mail-usr@localhost on Mail
  337 Prepare   call GetApacheAuth( ? )
  338 Prepare   call GetApacheAuth( ? )
  339 Prepare   call GetApacheAuth( ? )
  340 Prepare   call GetApacheAuth( ? )
  341 Connect   mail-usr@localhost on Mail
  341 Prepare   call GetApacheAuth( ? )
120709 20:33:04   342 Connect   mail-usr@localhost on Mail
  342 Prepare   call GetApacheAuth( ? )
and we never get any execute command

The apache log
[Mon Jul 09 20:22:57 2012] [error] [client 192.168.2.241] Query execution error 
looking up 'test.example' in database

At the shell prompt
user@machine:/tmp$ mysql --user=mail-usr --password= --host=localhost 
Mail -e  CALL GetApacheAuth('test.example');
+---+
| password  |
+---+
| y |
+---+


-- System Information:
Debian Release: 6.0.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libaprutil1-dbd-mysql depends on:
ii  libaprutil11.3.9+dfsg-5  The Apache Portable Runtime Utilit
ii  libc6  2.11.3-3  Embedded GNU C Library: Shared lib
ii  libmysqlclient16   5.1.63-0+squeeze1 MySQL database client library

libaprutil1-dbd-mysql recommends no packages.

libaprutil1-dbd-mysql suggests no packages.

-- no