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.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- Restricted Diffusion Commit
rP45c3a605ee7b: Correctly handle case where no ssh keys are found
Ran bin/ssh-auth before and after change with no ssh keys in the system. Error goes away after change.
Diff Detail
- Branch
- handle_no_ssh_entries
- Lint
Lint Errors Severity Location Code Message Error src/applications/auth/controller/PhabricatorEmailTokenController.php:54 PHL1 Unknown Symbol Error src/applications/calendar/view/AphrontCalendarMonthView.php:90 PHL1 Unknown Symbol Error src/applications/conpherence/controller/ConpherenceNotificationPanelController.php:75 PHL1 Unknown Symbol Error src/applications/differential/landing/DifferentialLandingToGitHub.php:85 PHL1 Unknown Symbol Error src/applications/differential/render/DifferentialChangesetHTMLRenderer.php:253 PHL1 Unknown Symbol Error src/applications/differential/view/DifferentialAddCommentView.php:189 PHL1 Unknown Symbol Error src/applications/differential/view/DifferentialInlineCommentView.php:233 PHL1 Unknown Symbol Error src/applications/differential/view/DifferentialLocalCommitsView.php:131 PHL1 Unknown Symbol Error src/applications/differential/view/DifferentialRevisionCommentView.php:90 PHL1 Unknown Symbol Error src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php:205 PHL1 Unknown Symbol Error src/applications/diffusion/controller/DiffusionCommitController.php:747 PHL1 Unknown Symbol Error src/applications/diffusion/view/DiffusionCommentView.php:142 PHL1 Unknown Symbol Error src/applications/feed/builder/PhabricatorFeedBuilder.php:51 PHL1 Unknown Symbol Error src/applications/feed/controller/PhabricatorFeedDetailController.php:30 PHL1 Unknown Symbol Error src/applications/feed/controller/PhabricatorFeedListController.php:35 PHL1 Unknown Symbol Error src/applications/feed/controller/PhabricatorFeedPublicStreamController.php:28 PHL1 Unknown Symbol Error src/applications/herald/controller/HeraldTranscriptController.php:371 PHL1 Unknown Symbol Error src/applications/maniphest/controller/ManiphestTaskDescriptionPreviewController.php:21 PHL1 Unknown Symbol Error src/applications/maniphest/controller/ManiphestTaskDetailController.php:352 PHL1 Unknown Symbol Error src/applications/notification/controller/PhabricatorNotificationListController.php:48 PHL1 Unknown Symbol Error src/applications/notification/controller/PhabricatorNotificationPanelController.php:23 PHL1 Unknown Symbol Error src/applications/people/controller/PhabricatorPeopleProfileController.php:130 PHL1 Unknown Symbol Error src/applications/phame/controller/post/PhamePostEditController.php:146 PHL1 Unknown Symbol Error src/applications/phame/controller/post/PhamePostPreviewController.php:26 PHL1 Unknown Symbol Error src/applications/phriction/storage/PhrictionContent.php:78 PHL1 Unknown Symbol - Unit
No Test Coverage
Event Timeline
I don't think we should exit 0 in this case, as sshd will attempt to read the output and authorize the user using the list of keys found on stdout. Although it's probably hard to escalate "No keys found.\n" into an access breach, it seems less confusing to prevent sshd from getting that far.
So, let's either emit this to stderr and exit 0 with empty stdout, or emit it to stdout and exit non-0.
This should also be pht()'d.
(That lint can be cleared by updating libphutil/. If you have several copies on disk, the copy you need to update is shown in the first few lines of arc list --trace. In some cases, it may not be the same copy which Phabricator uses at runtime. The symbol was added in rPHUff78852, so whichever copy is being loaded is older than that.)