[gvfs] Fix symlink target in query_info_reply() for sftp backend



commit 40fb32bef39e5fa590c82dd8d5f18bd974ccac5c
Author: Alexandre Rostovtsev <tetromino gmail com>
Date:   Tue Jun 14 04:55:38 2011 -0400

    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

 daemon/gvfsbackendsftp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index b8a21ae..4bb8cc8 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]