Bug 23250 - koha-create generates broken mysql password
Summary: koha-create generates broken mysql password
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 23090
Blocks: 25622
  Show dependency treegraph
 
Reported: 2019-07-02 07:08 UTC by Mirko Tietgen
Modified: 2020-11-30 21:45 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.02,18.11.08


Attachments
Bug 23250: Just use an @ in the password (1.29 KB, patch)
2019-07-04 00:33 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 23250: Just use an @ in the password (1.47 KB, patch)
2019-07-04 00:35 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 23250: Just use an @ in the password (1.54 KB, patch)
2019-07-04 08:32 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mirko Tietgen 2019-07-02 07:08:08 UTC
Using koha-create with latest master generates a broken mysql password in koha-conf.xml, like this

> <pass>B6_uW%vW"__DB_PASS__`1l(Gm</pass>

The problem does not appear when I revert the changes from bug 23090.

This will make every new instance unusable. It's in the nightly, that means new devboxes will be broken too I guess.
Comment 1 Mark Tompsett 2019-07-03 23:27:52 UTC
What was the koha-create command used to generate that?!

Because:
sudo koha-create --create-db {instance name}
generally is working for me.
Comment 2 Mark Tompsett 2019-07-04 00:33:48 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2019-07-04 00:35:35 UTC
Created attachment 91251 [details] [review]
Bug 23250: Just use an @ in the password

Rather than try to use -y and symbols, since
older versions of pwgen don't have the -y,
Purposefully just shorten the generated
password to 15 characters and put @ on the end.
This avoids nasty shell globbing, fixes the
MySQL requiring a symbol by default in the
newer versions.

While @ at the end is less secure, the
password portion providing security is
still 15 characters long.

Before patch, password should have potentially
multiple ugly symbols in it.
After patch, when creating an instance, the
password will have an @ at the end of it.
Comment 4 Martin Renvoize 2019-07-04 08:32:20 UTC
Created attachment 91284 [details] [review]
Bug 23250: Just use an @ in the password

Rather than try to use -y and symbols, since
older versions of pwgen don't have the -y,
Purposefully just shorten the generated
password to 15 characters and put @ on the end.
This avoids nasty shell globbing, fixes the
MySQL requiring a symbol by default in the
newer versions.

While @ at the end is less secure, the
password portion providing security is
still 15 characters long.

Before patch, password should have potentially
multiple ugly symbols in it.
After patch, when creating an instance, the
password will have an @ at the end of it.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2019-07-04 08:33:15 UTC
Simple patch that works well.

Thanks Mark, 

Going straight for PQA
Comment 6 Martin Renvoize 2019-07-04 08:33:43 UTC
Nice work!

Pushed to master for 19.11.00
Comment 7 Fridolin Somers 2019-07-23 12:49:12 UTC
Pushed to 19.05.x for 19.05.02
Comment 8 Lucas Gass 2019-07-23 14:54:37 UTC
backported to 18.11.x for 18.11.08
Comment 12 Jonathan Druart 2020-05-29 14:21:09 UTC
Ok, sorry, actually it was already without special chars prior to bug 23090!