Bug 23090 - MySQL validate_password plugin breaks koha-create
Summary: MySQL validate_password plugin breaks koha-create
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: master
Hardware: All All
: P1 - high blocker (vote)
Assignee: M. Tompsett
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 23250
  Show dependency treegraph
 
Reported: 2019-06-10 16:31 UTC by M. Tompsett
Modified: 2019-07-19 17:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.02


Attachments
Bug 23090: Add some special characters (928 bytes, patch)
2019-06-10 18:53 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 23090: Add some special characters (1.45 KB, patch)
2019-06-20 02:13 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 23090: Add some special characters (1.55 KB, patch)
2019-06-21 06:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description M. Tompsett 2019-06-10 16:31:52 UTC
When attempting to run a simple:
sudo koha-create --create-db NewInstance
The password generated lacks special characters which causes newer versions of MySQL (5.7.26 on Bionic) to fail.

This can be fixed either by lowering the:
set GLOBAL validate_password_policy='LOW';
-- or
Adding '-s -y' to all the pwgen calls in the koha-create script.

The later is more secure, and thus will be the patch here.
Comment 1 M. Tompsett 2019-06-10 18:53:54 UTC
Created attachment 90463 [details] [review]
Bug 23090: Add some special characters
Comment 2 M. Tompsett 2019-06-10 18:58:06 UTC
TEST PLAN
---------

$ sudo mysql -u root
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'badpassword';
[Magical MySQL Error]
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'GoodP@ssw0rd';
[Should be okay]
> DROP USER 'bug23090_test1'@'localhost';
> QUIT
$ sudo koha-create --create-db fail23090
[Magical MySQL Error]
[Apply this patch and put it (debian/scripts/koha-create) into place in /usr/sbin/koha-create]
$ sudo koha-create --create-db pass23090

Clean up of useless instances is left as an exercise to the reader.
Comment 3 Chris Cormack 2019-06-20 02:13:33 UTC
Created attachment 90822 [details] [review]
Bug 23090: Add some special characters

TEST PLAN
---------

$ sudo mysql -u root
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'badpassword';
[Magical MySQL Error]
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'GoodP@ssw0rd';
[Should be okay]
> DROP USER 'bug23090_test1'@'localhost';
> QUIT
$ sudo koha-create --create-db fail23090
[Magical MySQL Error]
[Apply this patch and put it (debian/scripts/koha-create) into place in
/usr/sbin/koha-create]
$ sudo koha-create --create-db pass23090

(Clean up and databases made)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 4 Marcel de Rooy 2019-06-21 06:08:25 UTC
Created attachment 90870 [details] [review]
Bug 23090: Add some special characters

TEST PLAN
---------

$ sudo mysql -u root
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'badpassword';
[Magical MySQL Error]
> CREATE USER 'bug23090_test1'@'localhost' IDENTIFIED BY 'GoodP@ssw0rd';
[Should be okay]
> DROP USER 'bug23090_test1'@'localhost';
> QUIT
$ sudo koha-create --create-db fail23090
[Magical MySQL Error]
[Apply this patch and put it (debian/scripts/koha-create) into place in
/usr/sbin/koha-create]
$ sudo koha-create --create-db pass23090

(Clean up and databases made)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Martin Renvoize 2019-06-21 09:16:14 UTC
Nice work!

Pushed to master for 19.11.00
Comment 6 Fridolin SOMERS 2019-07-15 13:37:09 UTC
Pushed to 19.05.x for 19.05.02
Comment 7 Lucas Gass 2019-07-19 17:16:39 UTC
backported to 18.11.x for 18.11.08