mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
libssh: no need to call sftp_get_error as ssh_get_error is sufficient
Fixes #2141 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
parent
3cef6f22ea
commit
8843c0939e
@ -896,7 +896,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
if(rc != 0 && !sshc->acceptfail) {
|
if(rc != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
Curl_safefree(sshc->quote_path2);
|
Curl_safefree(sshc->quote_path2);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
|
||||||
failf(data, "Attempt to set SFTP stats failed: %s",
|
failf(data, "Attempt to set SFTP stats failed: %s",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session));
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -916,7 +915,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
if(rc != 0 && !sshc->acceptfail) {
|
if(rc != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
Curl_safefree(sshc->quote_path2);
|
Curl_safefree(sshc->quote_path2);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
|
||||||
failf(data, "symlink command failed: %s",
|
failf(data, "symlink command failed: %s",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session));
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -932,7 +930,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
(mode_t)data->set.new_directory_perms);
|
(mode_t)data->set.new_directory_perms);
|
||||||
if(rc != 0 && !sshc->acceptfail) {
|
if(rc != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
|
||||||
failf(data, "mkdir command failed: %s",
|
failf(data, "mkdir command failed: %s",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session));
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -949,7 +946,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
if(rc != 0 && !sshc->acceptfail) {
|
if(rc != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
Curl_safefree(sshc->quote_path2);
|
Curl_safefree(sshc->quote_path2);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
|
||||||
failf(data, "rename command failed: %s",
|
failf(data, "rename command failed: %s",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session));
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -964,7 +960,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
rc = sftp_rmdir(sshc->sftp_session, sshc->quote_path1);
|
rc = sftp_rmdir(sshc->sftp_session, sshc->quote_path1);
|
||||||
if(rc != 0 && !sshc->acceptfail) {
|
if(rc != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
|
||||||
failf(data, "rmdir command failed: %s",
|
failf(data, "rmdir command failed: %s",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session));
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -979,7 +974,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
rc = sftp_unlink(sshc->sftp_session, sshc->quote_path1);
|
rc = sftp_unlink(sshc->sftp_session, sshc->quote_path1);
|
||||||
if(rc != 0 && !sshc->acceptfail) {
|
if(rc != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
|
||||||
failf(data, "rm command failed: %s",
|
failf(data, "rm command failed: %s",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session));
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -997,9 +991,8 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
statvfs = sftp_statvfs(sshc->sftp_session, sshc->quote_path1);
|
statvfs = sftp_statvfs(sshc->sftp_session, sshc->quote_path1);
|
||||||
if(statvfs != 0 && !sshc->acceptfail) {
|
if(statvfs != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
failf(data, "statvfs command failed: %s",
|
||||||
failf(data, "statvfs command failed: %s (%d)",
|
ssh_get_error(sshc->ssh_session));
|
||||||
ssh_get_error(sshc->ssh_session), err);
|
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
sshc->nextstate = SSH_NO_STATE;
|
sshc->nextstate = SSH_NO_STATE;
|
||||||
sshc->actualcode = CURLE_QUOTE_ERROR;
|
sshc->actualcode = CURLE_QUOTE_ERROR;
|
||||||
|
Loading…
Reference in New Issue
Block a user