summaryrefslogtreecommitdiff
path: root/extra/mariabackup/innobackupex.cc
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-04-01 21:47:30 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-04-01 21:47:30 +0200
commitfb9d151934c3444e55eb3ea505e2403d082c9a85 (patch)
treec6aeca6476d91839ac004685e89bcf24b0e72e71 /extra/mariabackup/innobackupex.cc
parent5bc5ecce081d235ac6faed0e22885b3a22e6edee (diff)
downloadmariadb-git-fb9d151934c3444e55eb3ea505e2403d082c9a85.tar.gz
MDEV-25321: mariabackup failed if password is passed via environment variablebb-10.2-MDEV-25321
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.
Diffstat (limited to 'extra/mariabackup/innobackupex.cc')
-rw-r--r--extra/mariabackup/innobackupex.cc7
1 files changed, 7 insertions, 0 deletions
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 <my_global.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <mysql.h>
#include <my_dir.h>
@@ -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;