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
This commit is contained in:
Somnath Kundu 2022-08-25 20:25:09 +05:30 committed by Daniel Stenberg
parent 576e507c78
commit 89d204036a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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;