mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Correctly handle case where no ssh keys are found
Summary: If no ssh keys are in phabricator, bin/ssh-auth errors with undefined `$lines`. This fixes that case and explicitly tells the user no rows were found. Test Plan: Ran bin/ssh-auth before and after change with no ssh keys in the system. Error goes away after change. Reviewers: #blessed_reviewers, epriestley Reviewed By: epriestley CC: epriestley, aran, Korvin Differential Revision: https://secure.phabricator.com/D7675
This commit is contained in:
parent
ba76526185
commit
45c3a605ee
1 changed files with 5 additions and 0 deletions
|
@ -15,6 +15,11 @@ $rows = queryfx_all(
|
|||
$user_dao->getTableName(),
|
||||
$ssh_dao->getTableName());
|
||||
|
||||
if (!$rows) {
|
||||
echo pht("No keys found.")."\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$bin = $root.'/bin/ssh-exec';
|
||||
foreach ($rows as $row) {
|
||||
$user = $row['userName'];
|
||||
|
|
Loading…
Reference in a new issue