mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-06-02 03:41:34 +03:00
Fix sftp_rename on sftp3
This commit is contained in:
parent
488e822c8d
commit
2c014256f7
@ -2339,8 +2339,9 @@ int sftp_rename(sftp_session sftp, const char *original, const char *newname) {
|
|||||||
if (buffer_add_u32(buffer, id) < 0 ||
|
if (buffer_add_u32(buffer, id) < 0 ||
|
||||||
buffer_add_ssh_string(buffer, oldpath) < 0 ||
|
buffer_add_ssh_string(buffer, oldpath) < 0 ||
|
||||||
buffer_add_ssh_string(buffer, newpath) < 0 ||
|
buffer_add_ssh_string(buffer, newpath) < 0 ||
|
||||||
/* POSIX rename atomically replaces newpath, we should do the same */
|
/* POSIX rename atomically replaces newpath, we should do the same
|
||||||
buffer_add_u32(buffer, SSH_FXF_RENAME_OVERWRITE) < 0) {
|
* only available on >=v4 */
|
||||||
|
sftp->version>=4 ? (buffer_add_u32(buffer, SSH_FXF_RENAME_OVERWRITE) < 0):0) {
|
||||||
ssh_set_error_oom(sftp->session);
|
ssh_set_error_oom(sftp->session);
|
||||||
ssh_buffer_free(buffer);
|
ssh_buffer_free(buffer);
|
||||||
ssh_string_free(oldpath);
|
ssh_string_free(oldpath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user