[Bug 1859773] Re: Apache DBD Auth not working with mysql

Haven Hash 1859773 at bugs.launchpad.net
Sat Mar 21 09:33:00 UTC 2020


Tested the 1.6.1-4ubuntu0.1 version and it worked for me. After
upgrading to 19.10 and newer MySQL, the apr_dbd_mysql.so would not load.
All configuration, permissions, apache and apr-dbd packages seemed to be
the same. Found this bug and did a one off install of the apr and apr-
mysql .debs from proposed and everything works again.

** Tags removed: verification-needed verification-needed-eoan
** Tags added: verification-done verification-done-eoan

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apr-util in Ubuntu.
https://bugs.launchpad.net/bugs/1859773

Title:
  Apache DBD Auth not working with mysql

Status in apr-util package in Ubuntu:
  Fix Released
Status in apr-util source package in Eoan:
  Fix Committed
Status in apr-util source package in Focal:
  Fix Released

Bug description:
  [Impact]
  The MySQL dbd driver fails to load into apache. This causes apache2 to fail to start if it's configured in this way.

  Since MySQL 8.0.2[1], the my_init() function is no longer exported,
  and it's not expected that clients will call it.

  Confirming that, the current build logs for apr-util show:
  /home/ubuntu/deb/apr-util/apr-util-1.6.1/dbd/apr_dbd_mysql.c:1267:5: warning: implicit declaration of function ‘my_init’; did you mean ‘mysql_init’? [-Wimplicit-function-declaration]
   1267 | my_init();
        | ^~~~~~~
        | mysql_init

  Furthermore, they also show[2] that loading the mysql driver failed,
  but that doesn't cause the build to fail (unknown reason: not
  addressed in this update):

  (...)
  Loaded pgsql driver OK.
  Failed to open pgsql[]
  Failed to load driver file apr_dbd_mysql.so <<<<<<<
  Loaded sqlite3 driver OK.
  (...)

  The fix is to not call my_init(). This was confirmed with MySQL
  upstream.

  [Test Case]
  * install and enable the dbd authentication module
  sudo apt update
  sudo apt install apache2 libaprutil1-dbd-mysql -y
  sudo a2enmod authn_dbd
  sudo systemctl restart apache2

  * confirm apache is still working:
  curl localhost

  * now enable the mysql driver
  echo DBDriver mysql | sudo tee /etc/apache2/conf-available/dbd_mysql.conf
  sudo a2enconf dbd_mysql

  * confirm error when restarting apache
  sudo systemctl restart apache2

  With the fixed packages, the restart above works just fine.

  [Regression Potential]
  A deprecated initialization function isn't being called anymore. This SRU isn't testing actual authentication using MySQL, just that the module now loads. There could be specific details in apr-utils that were being handled by my_init() before, and now aren't.

  [Other Info]
  Patch wasn't upstreamed because it should better check when to call my_init() and when not, i.e., check the mysql version properly and decide.

  
  [Original Description]
  Using Apache DBD auth for MySQL server 8 causes an error in Focal 20.04
  Same setup is working fine in 16.04 and 18.04

  The following line in Apache2/conf-enabled/ causes the error:
  DBDriver mysql

  apache start failed:
  apachectl[1188]: Can't load driver file apr_dbd_mysql.so

  The file exists in
  /usr/lib/x86_64-linux-gnu/apr-util-1/apr_dbd_mysql.so

  linking the file to
  /lib/apache2/modules/
  doesn't change the error message

  1. https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-2.html
  2. https://launchpadlibrarian.net/436958095/buildlog_ubuntu-eoan-amd64.apr-util_1.6.1-4build1_BUILDING.txt.gz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apr-util/+bug/1859773/+subscriptions



More information about the foundations-bugs mailing list