Page MenuHomePhabricator

Correctly handle case where no ssh keys are found
ClosedPublic

Authored by Firehed on Nov 30 2013, 8:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 4:53 AM
Unknown Object (File)
Fri, May 3, 2:17 AM
Unknown Object (File)
Thu, May 2, 9:37 AM
Unknown Object (File)
Mon, Apr 29, 1:38 PM
Unknown Object (File)
Sat, Apr 27, 1:33 PM
Unknown Object (File)
Sat, Apr 27, 1:33 PM
Unknown Object (File)
Wed, Apr 24, 9:47 PM
Unknown Object (File)
Mon, Apr 22, 12:04 PM

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP45c3a605ee7b: 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.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

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.

Firehed updated this revision to Unknown Object (????).Nov 30 2013, 5:45 PM
  • exit(1) on error

(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.)

Closed by commit rP45c3a605ee7b (authored by @Firehed, committed by @epriestley).