Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[2018.3] Fixes to verify_login in mysql module #50551
What does this PR do?
Ensure that verify_login is using the host from the connection_args and not the host associated with the user. Adding a test to ensure user_exists when the passed host is the MySQL wildcard %.
What issues does this PR fix or reference?
We should ensure we're using the hostname from connection_args when verifying the login.
Commits signed with GPG?
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.
doug-stratoscale left a comment
Thanks for taking a look at and fixing my issue..
However, I think there is a problem with the approach here for checking if a user exists. The hostname passed into the user_exists call is supposed to be the client host not the server host. Mysql users are specified by client host so "user1@host1" is different from "user1@host2". Using verify_login to check if "user1@host1" exists won't work because the verify method may be running for a host other than where "user1" intends to connect from. I believe this is why the original code was using a query against the INFORMATION_SCHEMA to determine existence.