From a4b94e21dc895f796e8a89be14416c8f949474ab Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 5 Jul 2018 15:50:12 +0200 Subject: bin/bootstrap-mysql: make granting of privileges optional --- bin/bootstrap-mysql | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'bin') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 15712c6..3d0a348 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -617,20 +617,22 @@ fi printf 'DELIMITER ;\n' - printf 'GRANT %s ON %s TO '"'"'buildmaster'"'"'@'"'"'localhost'"'"';\n' \ - 'CREATE ROUTINE' 'buildmaster.*' \ - 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ - 'EXECUTE' 'buildmaster.*' \ - 'RELOAD' '*.*' \ - 'SELECT' 'buildmaster.*' \ - 'SELECT' 'mysql.proc' \ - 'SHOW VIEW' 'buildmaster.*' \ - 'UPDATE' 'buildmaster.*' - printf 'GRANT %s ON %s TO '"'"'webserver'"'"'@'"'"'localhost'"'"';\n' \ - 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ - 'EXECUTE' 'buildmaster.*' \ - 'SELECT' 'buildmaster.*' \ - 'SHOW VIEW' 'buildmaster.*' - printf 'FLUSH PRIVILEGES;\n' + if [ "x$1" != 'x-no-privileges' ]; then + printf 'GRANT %s ON %s TO '"'"'buildmaster'"'"'@'"'"'localhost'"'"';\n' \ + 'CREATE ROUTINE' 'buildmaster.*' \ + 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ + 'EXECUTE' 'buildmaster.*' \ + 'RELOAD' '*.*' \ + 'SELECT' 'buildmaster.*' \ + 'SELECT' 'mysql.proc' \ + 'SHOW VIEW' 'buildmaster.*' \ + 'UPDATE' 'buildmaster.*' + printf 'GRANT %s ON %s TO '"'"'webserver'"'"'@'"'"'localhost'"'"';\n' \ + 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ + 'EXECUTE' 'buildmaster.*' \ + 'SELECT' 'buildmaster.*' \ + 'SHOW VIEW' 'buildmaster.*' + printf 'FLUSH PRIVILEGES;\n' + fi } | \ mysql_run_query -u root -p -- cgit v1.2.3-70-g09d2