You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
mcol-943
This commit is contained in:
@ -8729,6 +8729,8 @@ namespace oam
|
||||
******************************************************************************************/
|
||||
std::string Oam::getMySQLPassword()
|
||||
{
|
||||
string mysqlUser = "root";
|
||||
|
||||
string USER = "root";
|
||||
char* p= getenv("USER");
|
||||
if (p && *p)
|
||||
@ -8757,8 +8759,8 @@ namespace oam
|
||||
while (file.getline(line, 400))
|
||||
{
|
||||
buf = line;
|
||||
//find the mariadb user, root
|
||||
string::size_type pos = buf.find("root",0);
|
||||
string::size_type pos = buf.find(mysqlUser,0);
|
||||
|
||||
if (pos != string::npos)
|
||||
{
|
||||
file.getline(line, 400);
|
||||
@ -8771,12 +8773,15 @@ namespace oam
|
||||
if (pos1 != string::npos) {
|
||||
//password found
|
||||
|
||||
string password = buf.substr(pos1+2, 80);
|
||||
string password = buf.substr(pos1+1, 80);
|
||||
password.erase(remove_if(password.begin(), password.end(), ::isspace), password.end());
|
||||
|
||||
writeLog("getMySQLPassword: password found", LOG_TYPE_DEBUG);
|
||||
return password;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <limits.h>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#ifdef __linux__
|
||||
#include <sys/sysinfo.h>
|
||||
#include <netdb.h>
|
||||
|
Reference in New Issue
Block a user