fix(CORE/dbupdate)): allow to pass MySQL password via env (#13404)

* fix(CORE/dbupdate)): allow to pass MySQL password via env

+ fixed devContainer override file issue
+ added authserver dry-run in our CI
This commit is contained in:
Yehonal
2022-10-17 10:53:42 +02:00
committed by GitHub
parent b427e8e18c
commit c855e8d227
6 changed files with 31 additions and 24 deletions

View File

@@ -447,9 +447,6 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
args.emplace_back("-h" + host);
args.emplace_back("-u" + user);
if (!password.empty())
args.emplace_back("-p" + password);
// Check if we want to connect through ip or socket (Unix only)
#ifdef _WIN32
@@ -499,9 +496,14 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
if (!database.empty())
args.emplace_back(database);
auto env = boost::process::environment();
if (!password.empty())
env["MYSQL_PWD"]=password;
// Invokes a mysql process which doesn't leak credentials to logs
int const ret = Acore::StartProcess(DBUpdaterUtil::GetCorrectedMySQLExecutable(), args,
"sql.updates", "", true);
"sql.updates", "", true, env);
if (ret != EXIT_SUCCESS)
{