Mercurial > gftp.yaz
diff lib/sshv2.c @ 858:10e2ce91e26c
2006-11-30 Brian Masney <masneyb@gftp.org>
* lib/rfc959.c lib/sshv2.c src/uicommon/gftpui.c - don't abort the
entire file transfer if there is a permission denied at some point
during the file transfer. Give the user an error at the very end if
there were any errors. (closes #328550)
author | masneyb |
---|---|
date | Fri, 01 Dec 2006 00:57:50 +0000 |
parents | 0cf4d8c46b82 |
children | 1fae947d4418 |
line wrap: on
line diff
--- a/lib/sshv2.c Sun Nov 26 18:31:17 2006 +0000 +++ b/lib/sshv2.c Fri Dec 01 00:57:50 2006 +0000 @@ -896,6 +896,7 @@ sshv2_read_status_response (gftp_request * request, sshv2_message * message, int fd, int fxp_is_retryable, int fxp_is_wrong) { + guint32 num; int ret; memset (message, 0, sizeof (*message)); @@ -904,8 +905,15 @@ return (ret); else if (fxp_is_retryable > 0 && ret == fxp_is_retryable) { + memcpy (&num, message->buffer + 4, 4); + num = ntohl (num); + sshv2_message_free (message); - return (GFTP_ERETRYABLE); + + if (num == SSH_FX_PERMISSION_DENIED) + return (GFTP_EFATAL); + else + return (GFTP_ERETRYABLE); } else if (fxp_is_wrong > 0 && ret != fxp_is_wrong) return (sshv2_wrong_response (request, message)); @@ -923,10 +931,11 @@ case SSH_FX_OK: case SSH_FX_EOF: case SSH_FX_NO_SUCH_FILE: - case SSH_FX_PERMISSION_DENIED: case SSH_FX_FAILURE: case SSH_FX_OP_UNSUPPORTED: return (GFTP_ERETRYABLE); + case SSH_FX_PERMISSION_DENIED: + return (GFTP_EFATAL); default: return (sshv2_wrong_response (request, message)); }