From fb9d151934c3444e55eb3ea505e2403d082c9a85 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Thu, 1 Apr 2021 21:47:30 +0200 Subject: MDEV-25321: mariabackup failed if password is passed via environment variable The mariabackup interface currently supports passing a password through an explicit command line variable, but does not support passing a password through the MYSQL_PWD environment variable. At the same time, the Galera SST script for mariabackup uses the environment variable to pass the password, which leads (in some cases) to an unsuccessful launch of mariabackup and to the inability to start the cluster. This patch fixes this issue. It does not need a separate test, as the problem is visible in general testing on buildbot. --- extra/mariabackup/innobackupex.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc index fefd81dc1be..5bc320264e4 100644 --- a/extra/mariabackup/innobackupex.cc +++ b/extra/mariabackup/innobackupex.cc @@ -41,6 +41,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA #include #include +#include #include #include #include @@ -904,6 +905,12 @@ ibx_init() opt_user = opt_ibx_user; opt_password = opt_ibx_password; +#if !defined(DONT_USE_MYSQL_PWD) + if (!opt_password) + { + opt_password=getenv("MYSQL_PWD"); + } +#endif opt_host = opt_ibx_host; opt_defaults_group = opt_ibx_defaults_group; opt_socket = opt_ibx_socket; -- cgit v1.2.1