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

Launchpad Bug Tracker 1859773 at bugs.launchpad.net
Thu Mar 5 20:11:11 UTC 2020


This bug was fixed in the package apr-util - 1.6.1-4ubuntu2

---------------
apr-util (1.6.1-4ubuntu2) focal; urgency=medium

  * d/p/mysql8-my_init.patch: don't call my_init() since it's not
    exported anymore since MySQL 8.0.2 (LP: #1859773)

 -- Andreas Hasenack <andreas at canonical.com>  Wed, 04 Mar 2020 16:51:27
-0300

** Changed in: apr-util (Ubuntu Focal)
       Status: In Progress => Fix Released

-- 
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:
  In Progress
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