From: Somnath Kundu Date: Thu, 25 Aug 2022 14:55:09 +0000 (+0530) Subject: libssh2: provide symlink name in SFTP dir listing X-Git-Tag: curl-7_85_0~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89d204036a86e6e7bc3c2687917b57e5f94c9529;p=thirdparty%2Fcurl.git 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 --- 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;