Skip to content

Conversation

@grooverdan
Copy link
Contributor

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).

Test result should actually succeed. Add additional check for pamtest user.

Thanks Geoff Montee for bug report.

@grooverdan grooverdan changed the base branch from master to PHP-7.4 February 5, 2021 08:08
while ($row = $res->fetch_assoc()) {
if (isset($row['Name']) && ('mysql_clear_password' == $row['Name'])) {
$have_pam = true;
if (isset($row['Name']) && in_array($row['Name'], array('pam', 'mysql_clear_text', 'auth_pam_compat'))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the change from mysql_clear_password to mysql_clear_text intentional here? As far as I can tell, the plugin is called mysql_clear_password, even though various related options use the "cleartext" terminology instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. That was a mistake. Thanks @nikic . Force pushing now.

while ($row = $res->fetch_assoc()) {
if (isset($row['Name']) && ('mysql_clear_password' == $row['Name'])) {
$have_pam = true;
if (isset($row['Name']) && in_array($row['Name'], array('pam', 'mysql_clear_password', 'auth_pam_compat'))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line of code appears to be looping through the list of server-side plugins returned by SHOW PLUGINS.

mysql_clear_password is a client-side plugin used for the following server-side plugins:

  • pam (MariaDB Server and Percona Server)
  • auth_pam_compat (Percona Server)
  • authentication_pam (MySQL Enterprise Server).

As far as I know, Client-side plugins don't show up in the output of SHOW PLUGINS, so I don't think mysql_clear_password will ever show up in this loop. Should mysql_clear_password be removed from this specific check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opps. corrected to authentication_pam. Looked at https://dev.mysql.com/doc/refman/8.0/en/pam-pluggable-authentication.html#pam-pluggable-authentication-usage

I have pinged some MySQL community folks to test this their Enterprise side.

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.
@nikic
Copy link
Member

nikic commented Feb 15, 2021

Merged as 3646604 (with wrong PR reference...)

@nikic nikic closed this Feb 15, 2021
@grooverdan grooverdan deleted the bug-78680-pam branch February 15, 2021 10:41
@grooverdan
Copy link
Contributor Author

Thanks @nikic

@grooverdan
Copy link
Contributor Author

So as a master branch fix, not a PHP-7.4?

@nikic
Copy link
Member

nikic commented Feb 15, 2021

@grooverdan It's on PHP-7.4, GitHub just has trouble understanding out merge workflow :) Changes are merged up into master, so GitHub only shows that branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants