summaryrefslogtreecommitdiff
path: root/libssh2/libssh2_wrap.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-06-23 16:51:52 -0400
committerB. Stack <bgstack15@gmail.com>2024-06-23 16:51:52 -0400
commit994ec9e1cba547bed6eef02f996ca2a7beaf777a (patch)
treec6bdfb8c2096a1c579d3603e050d5f697d2306e0 /libssh2/libssh2_wrap.h
parentadd upstream 13.6 (diff)
downloadFreeFileSync-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.h14
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)
{
bgstack15