mirror of
https://github.com/curl/curl.git
synced 2026-05-07 03:37:28 +03:00
libssh: acknowledge SSH_AGAIN in the SFTP state machine
Reported in Joshua's sarif data Closes #18740
This commit is contained in:
parent
9595921b06
commit
b8f10be4f2
1 changed files with 12 additions and 0 deletions
|
|
@ -1959,6 +1959,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
|||
case SSH_SFTP_QUOTE_SETSTAT:
|
||||
rc = sftp_setstat(sshc->sftp_session, sshc->quote_path2,
|
||||
sshc->quote_attrs);
|
||||
if(rc == SSH_AGAIN)
|
||||
break;
|
||||
if(rc && !sshc->acceptfail) {
|
||||
Curl_safefree(sshc->quote_path1);
|
||||
Curl_safefree(sshc->quote_path2);
|
||||
|
|
@ -1978,6 +1980,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
|||
case SSH_SFTP_QUOTE_SYMLINK:
|
||||
rc = sftp_symlink(sshc->sftp_session, sshc->quote_path2,
|
||||
sshc->quote_path1);
|
||||
if(rc == SSH_AGAIN)
|
||||
break;
|
||||
if(rc && !sshc->acceptfail) {
|
||||
Curl_safefree(sshc->quote_path1);
|
||||
Curl_safefree(sshc->quote_path2);
|
||||
|
|
@ -1994,6 +1998,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
|||
case SSH_SFTP_QUOTE_MKDIR:
|
||||
rc = sftp_mkdir(sshc->sftp_session, sshc->quote_path1,
|
||||
(mode_t)data->set.new_directory_perms);
|
||||
if(rc == SSH_AGAIN)
|
||||
break;
|
||||
if(rc && !sshc->acceptfail) {
|
||||
Curl_safefree(sshc->quote_path1);
|
||||
failf(data, "mkdir command failed: %s",
|
||||
|
|
@ -2009,6 +2015,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
|||
case SSH_SFTP_QUOTE_RENAME:
|
||||
rc = sftp_rename(sshc->sftp_session, sshc->quote_path1,
|
||||
sshc->quote_path2);
|
||||
if(rc == SSH_AGAIN)
|
||||
break;
|
||||
if(rc && !sshc->acceptfail) {
|
||||
Curl_safefree(sshc->quote_path1);
|
||||
Curl_safefree(sshc->quote_path2);
|
||||
|
|
@ -2024,6 +2032,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
|||
|
||||
case SSH_SFTP_QUOTE_RMDIR:
|
||||
rc = sftp_rmdir(sshc->sftp_session, sshc->quote_path1);
|
||||
if(rc == SSH_AGAIN)
|
||||
break;
|
||||
if(rc && !sshc->acceptfail) {
|
||||
Curl_safefree(sshc->quote_path1);
|
||||
failf(data, "rmdir command failed: %s",
|
||||
|
|
@ -2038,6 +2048,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
|
|||
|
||||
case SSH_SFTP_QUOTE_UNLINK:
|
||||
rc = sftp_unlink(sshc->sftp_session, sshc->quote_path1);
|
||||
if(rc == SSH_AGAIN)
|
||||
break;
|
||||
if(rc && !sshc->acceptfail) {
|
||||
Curl_safefree(sshc->quote_path1);
|
||||
failf(data, "rm command failed: %s",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue