Merge #16452 - Fix #16451 - AWS RDS IAM authentication doesn't work because pma_password is truncated

Fixes: #16451
Pull-request: #16452

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-11-04 09:56:12 +01:00
commit 094ac77122
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -335,8 +335,11 @@ class AuthenticationCookie extends AuthenticationPlugin
$this->user = Core::sanitizeMySQLUser($_POST['pma_username']);
$password = $_POST['pma_password'] ?? '';
if (strlen($password) > 256) {
$password = substr($password, 0, 256);
if (strlen($password) >= 1000) {
$conn_error = __('Your password is too long. To prevent denial-of-service attacks, ' .
'phpMyAdmin restricts passwords to less than 1000 characters.');
return false;
}
$this->password = $password;