summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2015-02-26 14:20:48 +0100
committerOndrej Holy <oholy@redhat.com>2016-02-09 09:51:11 +0100
commitcf8a6cc2d9b13dc8fe949fa8b9eb320f8f06985e (patch)
tree43fa5c5546dc8c0996ab2ba250a8a19bfed109a9
parent74557b773b13fe9b2a1e838d5b6c1a0cc60e8fb9 (diff)
downloadgvfs-cf8a6cc2d9b13dc8fe949fa8b9eb320f8f06985e.tar.gz
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
-rw-r--r--daemon/gvfsjobqueryfsinfo.c3
-rw-r--r--daemon/gvfsjobqueryinfo.c2
-rw-r--r--daemon/gvfsjobqueryinforead.c5
-rw-r--r--daemon/gvfsjobqueryinfowrite.c5
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