Skip to content

Commit 45c3a60

Browse files
Firehedepriestley
authored and
epriestley
committedDec 1, 2013
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
1 parent ba76526 commit 45c3a60

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎scripts/ssh/ssh-auth.php

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
$user_dao->getTableName(),
1616
$ssh_dao->getTableName());
1717

18+
if (!$rows) {
19+
echo pht("No keys found.")."\n";
20+
exit(1);
21+
}
22+
1823
$bin = $root.'/bin/ssh-exec';
1924
foreach ($rows as $row) {
2025
$user = $row['userName'];

0 commit comments

Comments
 (0)
Failed to load comments.