mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #78680: mysqlnd pam plugin missing terminating null
The PAM service requires the terminating null to be part of the communication. Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat). Also changed MySQL Enterprise test to the server side plugin, authentication_pam as opposed to the client plugin mysql_clear_password. Add additional check for pamtest user and pam service file as all are required for the test. More importantly, test result should actually succeed. Thanks Geoff Montee for bug report. Closes GH-78680.
This commit is contained in:
parent
44a80b64b9
commit
3646604203
3 changed files with 55 additions and 7 deletions
|
@ -652,7 +652,11 @@ mysqlnd_pam_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self,
|
|||
if (passwd && passwd_len) {
|
||||
ret = (zend_uchar*) zend_strndup(passwd, passwd_len);
|
||||
}
|
||||
*auth_data_len = passwd_len;
|
||||
/*
|
||||
Trailing null required. bug#78680
|
||||
https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_authentication_methods_clear_text_password.html
|
||||
*/
|
||||
*auth_data_len = passwd_len + 1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue