mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Refs codership/mysql-wsrep#141: this commit
1. Passes wsrep_sst_auth_value to SST scripts via WSREP_SST_OPT_AUTH envronmental variable, so it never appears on the command line 2. In mysqldump and xtrabackup* SST scripts which rely on MySQL authentication, instead of passing password on the command line, SST script sets MYSQL_PWD environment variable, so that password also never appears on the mysqldump/innobackupex command line.
This commit is contained in:
committed by
Nirbhay Choubey
parent
4f4f3a5e32
commit
d78110e7fa
@ -44,6 +44,25 @@ private:
|
||||
extern wsp::node_status local_status;
|
||||
|
||||
namespace wsp {
|
||||
/* a class to manage env vars array */
|
||||
class env
|
||||
{
|
||||
private:
|
||||
size_t len_;
|
||||
char** env_;
|
||||
int errno_;
|
||||
bool ctor_common(char** e);
|
||||
void dtor();
|
||||
env& operator =(env);
|
||||
public:
|
||||
explicit env(char** env);
|
||||
explicit env(const env&);
|
||||
~env();
|
||||
int append(const char* var); /* add a new env. var */
|
||||
int error() const { return errno_; }
|
||||
char** operator()() { return env_; }
|
||||
};
|
||||
|
||||
/* A small class to run external programs. */
|
||||
class process
|
||||
{
|
||||
@ -56,8 +75,9 @@ private:
|
||||
public:
|
||||
/*! @arg type is a pointer to a null-terminated string which must contain
|
||||
either the letter 'r' for reading or the letter 'w' for writing.
|
||||
@arg env optional null-terminated vector of environment variables
|
||||
*/
|
||||
process (const char* cmd, const char* type);
|
||||
process (const char* cmd, const char* type, char** env);
|
||||
~process ();
|
||||
|
||||
FILE* pipe () { return io_; }
|
||||
@ -90,6 +110,8 @@ class string
|
||||
{
|
||||
public:
|
||||
string() : string_(0) {}
|
||||
explicit string(size_t s) : string_(static_cast<char*>(malloc(s))) {}
|
||||
char* operator()() { return string_; }
|
||||
void set(char* str) { if (string_) free (string_); string_ = str; }
|
||||
~string() { set (0); }
|
||||
private:
|
||||
|
Reference in New Issue
Block a user