can function sftp_upload return OK even if an error message is received?
Graziano Stefani (Nokia)
graziano.stefani at nokia.com
Wed May 14 00:51:48 AEST 2025
Hi,
With reference to the latest version of the portable OpenSSH, in file sftp-client.c, it looks to me there may be a bug in function sftp_upload.
My understanding is that, when variable "len" is equal to 0, no more SSH_FXP_WRITE messages are sent out and you start draining the queue of pending responses. Variable "len" is set to 0 either when the upload is interrupted, or when the SSH_FXP_STATUS response message carries an error, which sets variable "status" to a value different from SSH_FX_OK.
Can the variable "status" be overwritten by subsequent response messages to be again SSH_FX_OK? And, if this is the case, isn't it that the "read" is again called, variable "len" is set again to a non-zero value, and thus the function can return 0 even if an error message was received?
Kind regards,
Graziano Stefani.
More information about the openssh-unix-dev
mailing list