From cf8a6cc2d9b13dc8fe949fa8b9eb320f8f06985e Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Thu, 26 Feb 2015 14:20:48 +0100 Subject: job: Honor attribute mask in query info Unwanted attributes are sent from some backends (e.g. ftp), because g_file_info_copy_info is used and thus source attribute matcher is replaced. Apply attribute mask before sending as it is done in gvfsjobeneumerate to fix this issue. https://bugzilla.gnome.org/show_bug.cgi?id=745212 --- daemon/gvfsjobqueryfsinfo.c | 3 +++ daemon/gvfsjobqueryinfo.c | 2 ++ daemon/gvfsjobqueryinforead.c | 5 ++++- daemon/gvfsjobqueryinfowrite.c | 5 ++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/daemon/gvfsjobqueryfsinfo.c b/daemon/gvfsjobqueryfsinfo.c index f5f9791a..bbe5465a 100644 --- a/daemon/gvfsjobqueryfsinfo.c +++ b/daemon/gvfsjobqueryfsinfo.c @@ -156,6 +156,9 @@ create_reply (GVfsJob *job, G_FILE_ATTRIBUTE_GVFS_BACKEND, type); + g_file_info_set_attribute_mask (op_job->file_info, + op_job->attribute_matcher); + gvfs_dbus_mount_complete_query_filesystem_info (object, invocation, _g_dbus_append_file_info (op_job->file_info)); } diff --git a/daemon/gvfsjobqueryinfo.c b/daemon/gvfsjobqueryinfo.c index b963c2b9..7d7a1e00 100644 --- a/daemon/gvfsjobqueryinfo.c +++ b/daemon/gvfsjobqueryinfo.c @@ -162,6 +162,8 @@ create_reply (GVfsJob *job, op_job->attribute_matcher, op_job->file_info, op_job->uri); + g_file_info_set_attribute_mask (op_job->file_info, + op_job->attribute_matcher); gvfs_dbus_mount_complete_query_info (object, invocation, _g_dbus_append_file_info (op_job->file_info)); diff --git a/daemon/gvfsjobqueryinforead.c b/daemon/gvfsjobqueryinforead.c index 39a9347c..3e04d797 100644 --- a/daemon/gvfsjobqueryinforead.c +++ b/daemon/gvfsjobqueryinforead.c @@ -104,7 +104,10 @@ send_reply (GVfsJob *job) if (job->failed) g_vfs_channel_send_error (G_VFS_CHANNEL (op_job->channel), job->error); else - g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info); + { + g_file_info_set_attribute_mask (op_job->file_info, op_job->attribute_matcher); + g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info); + } } static void diff --git a/daemon/gvfsjobqueryinfowrite.c b/daemon/gvfsjobqueryinfowrite.c index e2c9327c..474cbfd6 100644 --- a/daemon/gvfsjobqueryinfowrite.c +++ b/daemon/gvfsjobqueryinfowrite.c @@ -104,7 +104,10 @@ send_reply (GVfsJob *job) if (job->failed) g_vfs_channel_send_error (G_VFS_CHANNEL (op_job->channel), job->error); else - g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info); + { + g_file_info_set_attribute_mask (op_job->file_info, op_job->attribute_matcher); + g_vfs_channel_send_info (G_VFS_CHANNEL (op_job->channel), op_job->file_info); + } } static void -- cgit v1.2.1