Skip to content

Commit 8fbb411

Browse files
author
epriestley
committed
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
1 parent 97cd7a9 commit 8fbb411

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/sql/manage_storage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@
206206
->setDisableUTF8MB4($args->getArg('disable-utf8mb4'));
207207
PhabricatorEnv::overrideConfig('mysql.user', $api->getUser());
208208

209+
$ref->setUser($selected_user);
210+
$ref->setPass($password);
211+
209212
try {
210213
queryfx(
211214
$api->getConn(null),

0 commit comments

Comments
 (0)