Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using password hashes with MariaDB #54343

Closed
wants to merge 1 commit into from

Conversation

pprkut
Copy link
Contributor

@pprkut pprkut commented Aug 29, 2019

MariaDB 10.2.0 introduced the 'ALTER USER' statement, but it did NOT remove the need to denote password hashes with the PASSWORD keyword.
Both CREATE USER as well as ALTER USER still need IDENTIFIED BY PASSWORD

This should be a more complete fix compared to previous attempts in #53861 and #54299

MariaDB always needs the 'PASSWORD' keyword when working with
password hashes, also when ALTER USER is being used.
@pprkut pprkut requested a review from a team as a code owner August 29, 2019 11:58
@ghost ghost requested a review from garethgreenaway August 29, 2019 11:58
@jeffdyke
Copy link

jeffdyke commented Sep 5, 2019

just a note, this will have to be looked at in 2019.2 as the second part of the diff is actually:

qry = ("ALTER USER '" + user + "'@'" + host + "'"                                                              |~                                                                                                                             
                       " IDENTIFIED BY '" + password + "';")                                                                   |~                                                                                                                             
                args = {}

Not sure why args is not used, i'll take your version and apply it to the recent release, which is actually the one i'm trying to fix. But thanks for getting into 2018.3

@jeffdyke
Copy link

jeffdyke commented Sep 5, 2019

apparently i have to dig a bit deeper, I'm on release 2019.2.0 which does not seem to correspond to branch 2019.2 in the mysql.py module. In the release version it is still using user_chpass, but in the branch that has changed to _user_chpass_[mysql|mariadb] I'll have to bring this up elsewhere.

@jeffdyke
Copy link

jeffdyke commented Sep 5, 2019

if anyone is looking to patch the current release, there is a diff attached
that can be applied with (paths may vary) sudo patch /usr/lib/python2.7/dist-packages/salt/modules/mysql.py /home/{user}/mysql.patch

mysql.py.2019.2.patch.txt

@SMillerDev
Copy link
Contributor

This should probably be rebuild since the build fails on:

13:12:15         13:11:26,209 [salt.minion                               :1676][ERROR   ] A command in 'pkg.info_installed' had a problem: package htop is not installed

Which doesn't really seem related to this change

@pprkut
Copy link
Contributor Author

pprkut commented Nov 6, 2019

@garethgreenaway Any chance we could move this forward. Currently we have to create our own rpms because of this :-/

@dwoz
Copy link
Contributor

dwoz commented Dec 14, 2019

@pprkut This needs to be re-opened against the master branch. We are no longer
accepting PRs to 2018.3. You can link back to this PR to perserver the
discussion. Sorry taking so long to get to this and for any confusion.

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.

4 participants