Bug #70063 [NEW]: Backronym fix breaks mysqlnd connection when configured without SSL

From: Date: Mon, 13 Jul 2015 12:10:58 +0000
Subject: Bug #70063 [NEW]: Backronym fix breaks mysqlnd connection when configured without SSL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194397@lists.php.net to get a copy of this message
From: dominic dot benson at thirdlight dot com Operating system: Linux PHP version: 5.4.43 Package: MySQL related Bug Type: Bug Bug description:Backronym fix breaks mysqlnd connection when configured without SSL Description: ------------ The 5.4 patch for #69669 (https://bugs.php.net/patch-display.php?bug_id=69669&patch=backronym-5.4&revision=1436080071&display=1) causes a regression in mysqlnd whereby if MYSQLND_SSL_SUPPORTED is not defined, attempting to connect results in a 'Packets out of order' error. This is because the patch introduces a new #else to the check, which calls PACKET_WRITE. This affects the MySQL and MySQLi extensions when using mysqlnd. The attached patch corrects this, and emits an E_WARNING if the CLIENT_SSL flag is set but cannot be honoured, rather than silently squashing it (which seemed rather contrary to the original purpose of the change). FWIW, I would probably advocate simply refusing to connect at all under those circumstances, but that is perhaps a more contentious change. Test script: --------------- <?php mysql_connect(); mysqli_connect(); Expected result: ---------------- (No output) Actual result: -------------- PHP Warning: Packets out of order. Expected 3 received 2. Packet size=22 in - on line 2 PHP Warning: mysql_connect(): MySQL server has gone away in - on line 2 PHP Warning: mysql_connect(): MySQL server has gone away in - on line 2 PHP Warning: Packets out of order. Expected 3 received 2. Packet size=22 in - on line 3 PHP Warning: mysql_connect(): MySQL server has gone away in - on line 3 PHP Warning: mysql_connect(): MySQL server has gone away in - on line 3 -- Edit bug report at https://bugs.php.net/bug.php?id=70063&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70063&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70063&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70063&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70063&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70063&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70063&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70063&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70063&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70063&r=support Expected behavior: https://bugs.php.net/fix.php?id=70063&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70063&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70063&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70063&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70063&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70063&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70063&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70063&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70063&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70063&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70063&r=mysqlcfg

« previous php.bugs (#194397) next »