summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendsftp.c
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gmail.com>2011-06-14 04:55:38 -0400
committerAlexander Larsson <alexl@redhat.com>2012-11-26 16:50:45 +0100
commit40fb32bef39e5fa590c82dd8d5f18bd974ccac5c (patch)
tree1184884541b0fbd17395cabd0ead687c3ca0e81e /daemon/gvfsbackendsftp.c
parent28f117d29163c79d60084cd74c1fd4e3a7b47694 (diff)
downloadgvfs-40fb32bef39e5fa590c82dd8d5f18bd974ccac5c.tar.gz
Fix symlink target in query_info_reply() for sftp backend
In SSH_FXP_NAME messages, the name field is preceded by a uint32 count field. query_info_reply() in gvfsbackendsftp.c did not take the existence of the count field into account, and so set symlink targets incorrectly. For a simple demonstration, use gvfs-info to stat a symlink on an ssh mount. https://bugzilla.gnome.org/show_bug.cgi?id=652535
Diffstat (limited to 'daemon/gvfsbackendsftp.c')
-rw-r--r--daemon/gvfsbackendsftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index b8a21aed..4bb8cc80 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -4016,6 +4016,8 @@ query_info_reply (GVfsBackendSftp *backend,
{
char *symlink_target;
+ /* Skip count (always 1 for replies to SSH_FXP_READLINK) */
+ g_data_input_stream_read_uint32 (reply->data, NULL, NULL);
symlink_target = read_string (reply->data, NULL);
g_file_info_set_symlink_target (op_job->file_info, symlink_target);
g_free (symlink_target);