Commit fb9d1519 authored by Julius Goryavsky's avatar Julius Goryavsky

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.
parent 5bc5ecce
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment