]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh2: provide symlink name in SFTP dir listing
authorSomnath Kundu <skundu07@gmail.com>
Thu, 25 Aug 2022 14:55:09 +0000 (20:25 +0530)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Aug 2022 15:37:10 +0000 (17:37 +0200)
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

index 9dfcd5eec0bf030781e6e7c2a62e7c99b01b16e7..02030c1ea34f459692ebc89e25cc6b801e705304 100644 (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;