diff options
author | B. Stack <bgstack15@gmail.com> | 2024-06-23 16:51:52 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-06-23 16:51:52 -0400 |
commit | 994ec9e1cba547bed6eef02f996ca2a7beaf777a (patch) | |
tree | c6bdfb8c2096a1c579d3603e050d5f697d2306e0 /libssh2/libssh2_wrap.h | |
parent | add upstream 13.6 (diff) | |
download | FreeFileSync-994ec9e1cba547bed6eef02f996ca2a7beaf777a.tar.gz FreeFileSync-994ec9e1cba547bed6eef02f996ca2a7beaf777a.tar.bz2 FreeFileSync-994ec9e1cba547bed6eef02f996ca2a7beaf777a.zip |
add upstream 13.713.7
Diffstat (limited to 'libssh2/libssh2_wrap.h')
-rw-r--r-- | libssh2/libssh2_wrap.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libssh2/libssh2_wrap.h b/libssh2/libssh2_wrap.h index fcb49855..2c99ac13 100644 --- a/libssh2/libssh2_wrap.h +++ b/libssh2/libssh2_wrap.h @@ -107,6 +107,20 @@ inline int libssh2_sftp_readlink(LIBSSH2_SFTP* sftp, const std::string& path, ch return libssh2_sftp_symlink_ex(sftp, path.c_str(), static_cast<unsigned int>(path.size()), buf, static_cast<unsigned int>(bufSize), LIBSSH2_SFTP_READLINK); } +#undef libssh2_sftp_symlink +inline int libssh2_sftp_symlink(LIBSSH2_SFTP* sftp, const std::string& path, const std::string_view buf) +{ + return libssh2_sftp_symlink_ex(sftp, + /* CAVEAT: https://www.sftp.net/spec/openssh-sftp-extensions.txt + "When OpenSSH's sftp-server was implemented, the order of the arguments + to the SSH_FXP_SYMLINK method was inadvertently reversed." + + => of course libssh2 didn't get the memo: fix this shit: */ + /**/ buf .data (), static_cast<unsigned int>(buf .size()), + const_cast<char*>(path.c_str()), static_cast<unsigned int>(path.size()), + LIBSSH2_SFTP_SYMLINK); +} + #undef libssh2_sftp_rename inline int libssh2_sftp_rename(LIBSSH2_SFTP* sftp, const std::string& pathFrom, const std::string& pathTo, long flags) { |