summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt')
-rw-r--r--ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt48
1 files changed, 24 insertions, 24 deletions
diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt
index 7799effe22..86e27fbaff 100644
--- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt
+++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt
@@ -10,56 +10,56 @@ phpinfo(INFO_MODULES);
$tmp = ob_get_contents();
ob_end_clean();
if (!stristr($tmp, "auth_plugin_sha256_password"))
- die("skip SHA256 auth plugin not built-in to mysqlnd");
+ die("skip SHA256 auth plugin not built-in to mysqlnd");
require_once('connect.inc');
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
- die(printf("skip: [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()));
+ die(printf("skip: [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()));
if (mysqli_get_server_version($link) < 50606)
- die("skip: SHA-256 requires MySQL 5.6.6+");
+ die("skip: SHA-256 requires MySQL 5.6.6+");
if (!($res = $link->query("SHOW PLUGINS"))) {
- die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
+ die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
}
$found = false;
while ($row = $res->fetch_assoc()) {
- if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) {
- $found = true;
- break;
- }
+ if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) {
+ $found = true;
+ break;
+ }
}
if (!$found)
- die("skip SHA-256 server plugin unavailable");
+ die("skip SHA-256 server plugin unavailable");
if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) {
- die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
+ die(sprintf("skip [%d] %s\n", $link->errno, $link->error));
}
if (!($row = $res->fetch_assoc())) {
- die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error));
+ die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error));
}
$key = $row['Value'];
if (strlen($key) < 100) {
- die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error));
+ die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error));
}
/* date changes may give false positive */
$file = "test_sha256_ini";
if ((file_exists($file) && !unlink($file)) || !($fp = @fopen($file, "w"))) {
- die(sprintf("skip Cannot create RSA pub key file '%s'", $file));
+ die(sprintf("skip Cannot create RSA pub key file '%s'", $file));
}
$key = str_replace("A", "a", $key);
$key = str_replace("M", "m", $key);
if (strlen($key) != fwrite($fp, $key)) {
- die(sprintf("skip Failed to create pub key file"));
+ die(sprintf("skip Failed to create pub key file"));
}
if (!$link->query("SET @@session.old_passwords=2")) {
- die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error));
+ die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error));
}
$link->query('DROP USER shatest');
@@ -67,24 +67,24 @@ $link->query("DROP USER shatest@localhost");
if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') ||
- !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) {
- die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error));
+ !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) {
+ die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error));
}
if (!$link->query('SET PASSWORD FOR shatest@"%" = PASSWORD("shatest")') ||
- !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) {
- die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error));
+ !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) {
+ die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error));
}
if (!$link->query("DROP TABLE IF EXISTS test") ||
- !$link->query("CREATE TABLE test (id INT)") ||
- !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)"))
- die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
+ !$link->query("CREATE TABLE test (id INT)") ||
+ !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)"))
+ die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) ||
- !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) {
- die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)));
+ !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) {
+ die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)));
}
$link->close();