From 89d204036a86e6e7bc3c2687917b57e5f94c9529 Mon Sep 17 00:00:00 2001 From: Somnath Kundu Date: Thu, 25 Aug 2022 20:25:09 +0530 Subject: [PATCH] libssh2: provide symlink name in SFTP dir listing When reading the symbolic link name for a file, we need to add the file name to base path name. Closes #9369 --- lib/vssh/libssh2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 9dfcd5eec0..02030c1ea3 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -2338,7 +2338,8 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) ((sshp->readdir_attrs.permissions & LIBSSH2_SFTP_S_IFMT) == LIBSSH2_SFTP_S_IFLNK)) { Curl_dyn_init(&sshp->readdir_link, PATH_MAX); - result = Curl_dyn_add(&sshp->readdir_link, sshp->path); + result = Curl_dyn_addf(&sshp->readdir_link, "%s%s", sshp->path, + sshp->readdir_filename); state(data, SSH_SFTP_READDIR_LINK); if(!result) break; -- 2.47.3