diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-17 20:01:34 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-17 20:05:22 +0200 |
commit | fd2ff2d29ccf1feba4a6f08f6fe2abe734994e52 (patch) | |
tree | 4324b0c1adae962ebc03c973a9606f5140850b6e | |
parent | 0b09bd900f857aac928cd7e6bc059b1e0c8b718a (diff) | |
download | libssh-fd2ff2d29ccf1feba4a6f08f6fe2abe734994e52.tar.gz libssh-fd2ff2d29ccf1feba4a6f08f6fe2abe734994e52.tar.xz libssh-fd2ff2d29ccf1feba4a6f08f6fe2abe734994e52.zip |
Fix sftp_rename on sftp3
-rw-r--r-- | libssh/sftp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c index 64d1aa66..1509c5ad 100644 --- a/libssh/sftp.c +++ b/libssh/sftp.c @@ -2340,8 +2340,9 @@ int sftp_rename(sftp_session sftp, const char *original, const char *newname) { if (buffer_add_u32(buffer, id) < 0 || buffer_add_ssh_string(buffer, oldpath) < 0 || buffer_add_ssh_string(buffer, newpath) < 0 || - /* POSIX rename atomically replaces newpath, we should do the same */ - buffer_add_u32(buffer, SSH_FXF_RENAME_OVERWRITE) < 0) { + /* POSIX rename atomically replaces newpath, we should do the same + * only available on >=v4 */ + sftp->version>=4 ? (buffer_add_u32(buffer, SSH_FXF_RENAME_OVERWRITE) < 0):0) { ssh_set_error_oom(sftp->session); buffer_free(buffer); string_free(oldpath); |