Changeset View
Changeset View
Standalone View
Standalone View
scripts/ssh/ssh-auth.php
Context not available. | |||||
$authstruct = null; | $authstruct = null; | ||||
if (strlen($authstruct_raw)) { | if (@strlen($authstruct_raw)) { | ||||
try { | try { | ||||
$authstruct = phutil_json_decode($authstruct_raw); | $authstruct = phutil_json_decode($authstruct_raw); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
Context not available. | |||||
// Strip out newlines and other nonsense from the key type and key body. | // Strip out newlines and other nonsense from the key type and key body. | ||||
$type = $ssh_key->getKeyType(); | $type = $ssh_key->getKeyType(); | ||||
$type = preg_replace('@[\x00-\x20]+@', '', $type); | $type = preg_replace('@[\x00-\x20]+@', '', $type); | ||||
if (!strlen($type)) { | if (!@strlen($type)) { | ||||
continue; | continue; | ||||
} | } | ||||
$key = $ssh_key->getKeyBody(); | $key = $ssh_key->getKeyBody(); | ||||
$key = preg_replace('@[\x00-\x20]+@', '', $key); | $key = preg_replace('@[\x00-\x20]+@', '', $key); | ||||
if (!strlen($key)) { | if (!@strlen($key)) { | ||||
continue; | continue; | ||||
} | } | ||||
Context not available. | |||||
$cmd = csprintf('%s %Ls', $bin, $key_argv); | $cmd = csprintf('%s %Ls', $bin, $key_argv); | ||||
if (strlen($instance)) { | if (@strlen($instance)) { | ||||
$cmd = csprintf('PHABRICATOR_INSTANCE=%s %C', $instance, $cmd); | $cmd = csprintf('PHABRICATOR_INSTANCE=%s %C', $instance, $cmd); | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0