Browse Source

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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Mark Tompsett 5 years ago
committed by Martin Renvoize
parent
commit
f56bba9297
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 5
      debian/scripts/koha-create

5
debian/scripts/koha-create

@ -579,7 +579,10 @@ if [ "$op" = create ] || [ "$op" = request ] || [ "$op" = use ]
then
if [ "$mysqlpwd" = "" ]
then
mysqlpwd="$(pwgen -s 16 1)"
# over-size, so when problematic chars are removed,
# still likely 16 characters left.
mysqlpwd="$(pwgen -s -y 32 1)"
mysqlpwd="$(echo $mysqlpwd | tr -d :\'\\\<\>\/ | cut -c1-16)"
fi
else
mysqlpwd="$(getinstancemysqlpassword $name)"

Loading…
Cancel
Save