mirror of https://github.com/wolfSSL/wolfssh.git
set ssh error in sftp status not ok state
parent
834a03ce84
commit
cb4a50a764
|
@ -86,6 +86,16 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Test fail on file that does not exist
|
||||||
|
rm -rf sample1-does-not-exist
|
||||||
|
if ./examples/sftpclient/wolfsftp -u jill -P upthehill -p "$PORT" \
|
||||||
|
-G -l sample1-copy.txt -r sample1-does-not-exist
|
||||||
|
then
|
||||||
|
echo "Success when expecting fail to get file."
|
||||||
|
do_cleanup
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Put test.
|
# Put test.
|
||||||
if ! ./examples/sftpclient/wolfsftp -u jill -P upthehill -p "$PORT" \
|
if ! ./examples/sftpclient/wolfsftp -u jill -P upthehill -p "$PORT" \
|
||||||
-g -l sample2.txt -r sample2-copy.txt
|
-g -l sample2.txt -r sample2-copy.txt
|
||||||
|
|
|
@ -5302,6 +5302,12 @@ static int wolfSSH_SFTP_DoStatus(WOLFSSH* ssh, word32 reqId,
|
||||||
}
|
}
|
||||||
|
|
||||||
wolfSSH_SFTP_buffer_seek(buffer, 0, localIdx);
|
wolfSSH_SFTP_buffer_seek(buffer, 0, localIdx);
|
||||||
|
|
||||||
|
if (status != WOLFSSH_FTP_OK &&
|
||||||
|
ssh->error != WS_WANT_READ && ssh->error != WS_WANT_WRITE) {
|
||||||
|
/* set ssh error as the SFTP status not being ok */
|
||||||
|
ssh->error = WS_SFTP_STATUS_NOT_OK;
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue