From f1fc95cef1082ba20209b17d1ec86636cc15f261 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 13 Jul 2026 10:59:14 +0200 Subject: [PATCH] Update misc/tools.func Co-authored-by: Sam Heinz --- misc/tools.func | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 5c02d3830..dfdf38536 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -6755,14 +6755,9 @@ setup_mariadb_db() { # Use --defaults-extra-file to pass credentials safely and escape identifiers # to prevent SQL injection via DB name / user / password - local _db_escaped _user_escaped _pass_escaped - _db_escaped="${MARIADB_DB_NAME//\'/\'\'}" - _user_escaped="${MARIADB_DB_USER//\'/\'\'}" - _pass_escaped="${MARIADB_DB_PASS//\'/\'\'}" - - $STD mariadb -u root -e "CREATE DATABASE \`$_db_escaped\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" - $STD mariadb -u root -e "CREATE USER '$_user_escaped'@'localhost' IDENTIFIED BY '$_pass_escaped';" - $STD mariadb -u root -e "GRANT ALL ON \`$_db_escaped\`.* TO '$_user_escaped'@'localhost';" + $STD mariadb -u root -e "CREATE DATABASE \`${MARIADB_DB_NAME//\`/\`\`}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" + $STD mariadb -u root -e "CREATE USER '${MARIADB_DB_USER//\'/\'\'}'@'localhost' IDENTIFIED BY '${MARIADB_DB_PASS//\'/\'\'}';" + $STD mariadb -u root -e "GRANT ALL ON \`${MARIADB_DB_NAME//\`/\`\`}\`.* TO '${MARIADB_DB_USER//\'/\'\'}'@'localhost';" # Optional extra grants if [[ -n "${MARIADB_DB_EXTRA_GRANTS:-}" ]]; then