mirror of https://github.com/wolfSSL/wolfssh.git
Merge pull request #655 from JacobBarthelmeh/sshd_forcedcmd
set pipes as non blocking before last readpull/658/head
commit
71ba56a7d4
|
@ -1606,11 +1606,15 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
|
||||||
if (forcedCmd) {
|
if (forcedCmd) {
|
||||||
int readSz;
|
int readSz;
|
||||||
|
|
||||||
|
fcntl(stdoutPipe[0], F_SETFL, fcntl(stdoutPipe[0], F_GETFL)
|
||||||
|
| O_NONBLOCK);
|
||||||
readSz = (int)read(stdoutPipe[0], shellBuffer, sizeof shellBuffer);
|
readSz = (int)read(stdoutPipe[0], shellBuffer, sizeof shellBuffer);
|
||||||
if (readSz > 0) {
|
if (readSz > 0) {
|
||||||
wolfSSH_ChannelIdSend(ssh, shellChannelId, shellBuffer, readSz);
|
wolfSSH_ChannelIdSend(ssh, shellChannelId, shellBuffer, readSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fcntl(stderrPipe[0], F_SETFL, fcntl(stderrPipe[0], F_GETFL)
|
||||||
|
| O_NONBLOCK);
|
||||||
readSz = (int)read(stderrPipe[0], shellBuffer, sizeof shellBuffer);
|
readSz = (int)read(stderrPipe[0], shellBuffer, sizeof shellBuffer);
|
||||||
if (readSz > 0) {
|
if (readSz > 0) {
|
||||||
wolfSSH_extended_data_send(ssh, shellBuffer, readSz);
|
wolfSSH_extended_data_send(ssh, shellBuffer, readSz);
|
||||||
|
|
Loading…
Reference in New Issue