Bugzilla – Attachment 105436 Details for
Bug 25622
Change way MySQL password is generated by koha-create
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25622: Use special chars in DB password (koha-create)
Bug-25622-Use-special-chars-in-DB-password-koha-cr.patch (text/plain), 1.80 KB, created by
Jonathan Druart
on 2020-05-29 14:16:18 UTC
(
hide
)
Description:
Bug 25622: Use special chars in DB password (koha-create)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-29 14:16:18 UTC
Size:
1.80 KB
patch
obsolete
>From caf1a9291335e598e717cdf5a596ae8a8f60cf34 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 29 May 2020 16:10:58 +0200 >Subject: [PATCH] Bug 25622: Use special chars in DB password (koha-create) > >On bug 23250 we decided to generate a password without special chars then add a >'@' at the end to comply with MySQL policy. >That is wrong, we should handle correctly the special chars we don't want to be >part of the password. > >Test plan: >1. >mysqlpwd="$(pwgen -s -y 32 1)" >echo $mysqlpwd >mysqlpwd="$(echo $mysqlpwd | tr -d :\'\&\\\\\<\>\/ | cut -c1-16)" >echo $mysqlpwd > >Confirm that in the second line you don't see one of the following chars : ' & \ < > / > >2. >Copy from src and edit /usr/sbin/koha-create to add an echo $mysqlpwd >Create several instances, like: >koha-create --create-db x >koha-create --create-db xx >koha-create --create-db xxx >... > >When you see a password with a special chars, do: >koha-shell xxx >grep '<pass>' $KOHA_CONF >And make sure the password does not contain "__DB_PASS__" >--- > debian/scripts/koha-create | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index b90e7d4e23..3be332fce4 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -592,8 +592,12 @@ if [ "$op" = create ] || [ "$op" = request ] || [ "$op" = use ] > then > if [ "$mysqlpwd" = "" ] > then >- mysqlpwd="$(pwgen -s 15 1)" >- mysqlpwd="$mysqlpwd@" >+ # over-size, so when problematic chars are removed, >+ # still likely 16 characters left. >+ # Removing : ' & \ < > / >+ mysqlpwd="$(pwgen -s -y 32 1)" >+ mysqlpwd="$(echo $mysqlpwd | tr -d :\'\&\\\\\<\>\/ | cut -c1-16)" >+ > fi > else > mysqlpwd="$(getinstancemysqlpassword $name)" >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25622
:
105436
|
105504
|
105626
|
105779
|
136559