mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 09:12:41 +01:00
(stable) Respect user/pass flags to bin/storage for direct DatabaseRef-based queries
Summary: Ref T11893. Previously, we excuted all `bin/storage` queries through `StorageManagementAPI` objects. After D16848, we execute some queries through `PhabricatorDatabaseRef`. However, the refs we use weren't getting passed the `-u` / `-p` flags correctly, for specifying alternate administrative credentials. Test Plan: - Created a second account (`trunk`). - Ran `bin/storage -u trunk`. - Made libphutil throw when not connecting as that user. - Before patch: some connections incorrectly used the default user, "root". - After patch: all connections correctly used the configured user, "trunk". Reviewers: chad Reviewed By: chad Maniphest Tasks: T11893 Differential Revision: https://secure.phabricator.com/D16901
This commit is contained in:
parent
10c4dedd18
commit
74a0e5cd79
1 changed files with 3 additions and 0 deletions
|
@ -206,6 +206,9 @@ foreach ($refs as $ref) {
|
|||
->setDisableUTF8MB4($args->getArg('disable-utf8mb4'));
|
||||
PhabricatorEnv::overrideConfig('mysql.user', $api->getUser());
|
||||
|
||||
$ref->setUser($selected_user);
|
||||
$ref->setPass($password);
|
||||
|
||||
try {
|
||||
queryfx(
|
||||
$api->getConn(null),
|
||||
|
|
Loading…
Reference in a new issue