Bug 23090

Summary: MySQL validate_password plugin breaks koha-create
Product: Koha Reporter: M. Tompsett <mtompset>
Component: Installation and upgrade (command-line installer)Assignee: M. Tompsett <mtompset>
Status: RESOLVED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: blocker    
Priority: P1 - high CC: fridolin.somers, lucas, m.de.rooy
Version: master   
Hardware: All   
OS: All   
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
Bug Depends on:    
Bug Blocks: 23250    
Attachments: Bug 23090: Add some special characters
Bug 23090: Add some special characters
Bug 23090: Add some special characters

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