mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 20:12:44 +00:00
SSH/Agent: add support for named pipes on windows (for pageant)
This commit is contained in:
parent
8907a4bd5b
commit
218c7e5207
@ -133,10 +133,21 @@ class Agent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array('unix', stream_get_transports())) {
|
||||||
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
|
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
|
||||||
if (!$this->fsock) {
|
if (!$this->fsock) {
|
||||||
user_error("Unable to connect to ssh-agent (Error $errno: $errstr)");
|
user_error("Unable to connect to ssh-agent (Error $errno: $errstr)");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (substr($address, 0, 9) != '\\\\.\\pipe\\' || strpos(substr($address, 9), '\\') !== false) {
|
||||||
|
user_error('Address is not formatted as a named pipe should be');
|
||||||
|
} else {
|
||||||
|
$this->fsock = fopen($address, 'r+b');
|
||||||
|
if (!$this->fsock) {
|
||||||
|
user_error('Unable to open address');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user