mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-06-03 14:42:01 +03:00
proxycommand: check the return values of pipe().
This commit is contained in:
parent
81793de030
commit
9739dae794
@ -934,12 +934,21 @@ int ssh_socket_connect_proxycommand(ssh_socket s, const char *command){
|
|||||||
socket_t in_pipe[2];
|
socket_t in_pipe[2];
|
||||||
socket_t out_pipe[2];
|
socket_t out_pipe[2];
|
||||||
int pid;
|
int pid;
|
||||||
|
int rc;
|
||||||
ssh_session session=s->session;
|
ssh_session session=s->session;
|
||||||
enter_function();
|
enter_function();
|
||||||
if(s->state != SSH_SOCKET_NONE)
|
if(s->state != SSH_SOCKET_NONE)
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
pipe(in_pipe);
|
|
||||||
pipe(out_pipe);
|
rc = pipe(in_pipe);
|
||||||
|
if (rc < 0) {
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
rc = pipe(out_pipe);
|
||||||
|
if (rc < 0) {
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if(pid == 0){
|
if(pid == 0){
|
||||||
ssh_execute_command(command,out_pipe[0],in_pipe[1]);
|
ssh_execute_command(command,out_pipe[0],in_pipe[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user