Bugzilla – Attachment 4464 Details for
Bug 6482
koha-create makes assumptions about the mysql username
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6482 - allow the mysql details to be changed during koha-create
Bug-6482---allow-the-mysql-details-to-be-changed-d.patch (text/plain), 2.67 KB, created by
Chris Cormack
on 2011-06-14 21:57:22 UTC
(
hide
)
Description:
Bug 6482 - allow the mysql details to be changed during koha-create
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-06-14 21:57:22 UTC
Size:
2.67 KB
patch
obsolete
>From 91b91fdc261891a6d9d01a798a59ed3b60d0da72 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Wed, 8 Jun 2011 15:10:09 +1200 >Subject: [PATCH] Bug 6482 - allow the mysql details to be changed during koha-create > >This allows the database details (username and database name in >particular) to be modified in between a koha-create --request-db and >--populate-db. Most useful when you discover that the username is too >long or something. Now, when populating the database, the connection >information is reloaded from the koha-conf.xml rather than being >generated from the instance name. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > debian/scripts/koha-create | 21 ++++++++++++++++----- > 1 files changed, 16 insertions(+), 5 deletions(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index e3c73fc..80c9cac 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -54,10 +54,16 @@ getmysqlhost() { > } > > getinstancemysqlpassword() { >- sed -n '/<pass>/s:.*>\(.*\)</pass>.*:\1:p' \ >- "/etc/koha/sites/$1/koha-conf.xml" >+ xmlstarlet sel -t -v 'yazgfs/config/pass' "/etc/koha/sites/$1/koha-conf.xml" > } > >+getinstancemysqluser() { >+ xmlstarlet sel -t -v 'yazgfs/config/user' "/etc/koha/sites/$1/koha-conf.xml" >+} >+ >+getinstancemysqldatabase() { >+ xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml" >+} > > # Set defaults and read config file, if it exists. > DOMAIN="" >@@ -124,7 +130,7 @@ then > koha-create-dirs "$name" > > # Generate Zebra database password. >- zebrapwd="$(pwgen -1)" >+ zebrapwd="$(pwgen -s 12 1)" > # Set up MySQL database for this instance. > if [ "$op" = create ] > then >@@ -134,7 +140,7 @@ CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd'; > GRANT ALL PRIVILEGES ON \`$mysqldb\`.* TO \`$mysqluser\`; > FLUSH PRIVILEGES; > eof >- fi >+ fi #` > > # Generate and install Apache site-available file and log dir. > generate_config_file apache-site.conf.in \ >@@ -183,6 +189,11 @@ fi > > if [ "$op" = create ] || [ "$op" = populate ] > then >+ # Re-fetch the passwords from the config we've generated, allows it >+ # to be different from what we set, in case the user had to change >+ # something. >+ mysqluser=$(getinstancemysqluser $name) >+ mysqldb=$(getinstancemysqldatabase $name) > # Use the default database content if that exists. > if [ -e "$DEFAULTSQL" ] > then >@@ -205,7 +216,7 @@ UPDATE borrowers > SET password = '$staffdigest' > WHERE borrowernumber = 3; > eof >- >+ #` > echo "staff user password is '$staffpass' but keep that secret" > > # Upgrade the database schema, just in case the dump was from an >-- >1.7.4.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 6482
:
4429
| 4464