Changeset View
Changeset View
Standalone View
Standalone View
scripts/ssh/ssh-auth-key.php
- This file was copied from scripts/ssh/ssh-auth.php.
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| if (!PhabricatorUser::validateUsername($user)) { | if (!PhabricatorUser::validateUsername($user)) { | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| $bin = $root.'/bin/ssh-exec'; | $bin = $root.'/bin/ssh-exec'; | ||||
| $cmd = csprintf('%s --phabricator-ssh-user %s', $bin, $user); | $cmd = csprintf('%s --phabricator-ssh-user %s', $bin, $user); | ||||
| // This is additional escaping for the SSH 'command="..."' string. | // This is additional escaping for the SSH 'command="..."' string. | ||||
| $cmd = str_replace('"', '\\"', $cmd); | $cmd = addcslashes($cmd, '"\\'); | ||||
| $options = array( | $options = array( | ||||
| 'command="'.$cmd.'"', | 'command="'.$cmd.'"', | ||||
| 'no-port-forwarding', | 'no-port-forwarding', | ||||
| 'no-X11-forwarding', | 'no-X11-forwarding', | ||||
| 'no-agent-forwarding', | 'no-agent-forwarding', | ||||
| 'no-pty', | 'no-pty', | ||||
| ); | ); | ||||
| echo implode(',', $options); | echo implode(',', $options); | ||||
| exit(0); | exit(0); | ||||