]> granicus.if.org Git - php/commitdiff
Skipping if MySQL old password algorithm is in use as it seems to be the case on...
authorUlf Wendel <uw@php.net>
Wed, 4 Nov 2009 16:09:07 +0000 (16:09 +0000)
committerUlf Wendel <uw@php.net>
Wed, 4 Nov 2009 16:09:07 +0000 (16:09 +0000)
ext/mysql/tests/mysql_pconn_max_links.phpt

index 1d39e98b429f64a024e392286428b12ece02cf11..3eca0e534a833d0370544b9fd40d41ab2f0db0bf 100644 (file)
@@ -18,6 +18,19 @@ Persistent connections and mysql.max_persistent
        if (!mysql_select_db($db, $link))
                die(sprintf("skip [%d] %s", mysql_errno($link), mysql_error($link)));
 
+       if (!$res = mysql_query('SHOW VARIABLES LIKE "old_passwords"', $link)) {
+               die(sprintf("skip [%d] %s", mysql_errno($link), mysql_error($link)));
+       }
+
+       if (mysql_num_rows($res) != 1) {
+               die(sprintf("skip Can't check if old_passwords = ON"));
+       }
+
+       $row = mysql_fetch_assoc($res);
+       mysql_free_result($res);
+       if ($row['Value'] == "ON")
+               die(sprintf("skip Test will fail because old_passwords = ON. Hint: old passwords are insecure!"));
+
        if (!$res = mysql_query("SELECT CURRENT_USER() AS _user", $link))
                die(sprintf("skip [%d] %s", mysql_errno($link), mysql_error($link)));