[tracker/tracker-0.12] tracker-writeback: Check for write permission
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.12] tracker-writeback: Check for write permission
- Date: Fri, 25 Nov 2011 15:44:51 +0000 (UTC)
commit 64ab00bcbdb1b40bbc312d90ab21d743b75661dd
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Nov 9 12:55:44 2011 +0100
tracker-writeback: Check for write permission
Fixes NB#289953.
src/tracker-writeback/tracker-writeback-file.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-file.c b/src/tracker-writeback/tracker-writeback-file.c
index c952c63..652169b 100644
--- a/src/tracker-writeback/tracker-writeback-file.c
+++ b/src/tracker-writeback/tracker-writeback-file.c
@@ -181,7 +181,8 @@ tracker_writeback_file_update_metadata (TrackerWriteback *writeback,
file_info = g_file_query_info (file,
G_FILE_ATTRIBUTE_UNIX_MODE ","
- G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+ G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
NULL, NULL);
@@ -197,6 +198,19 @@ tracker_writeback_file_update_metadata (TrackerWriteback *writeback,
return FALSE;
}
+ if (!g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) {
+ g_object_unref (file_info);
+ g_object_unref (file);
+
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "%s not writable",
+ row[0]);
+
+ return FALSE;
+ }
+
mime_type = g_file_info_get_content_type (file_info);
content_types = (writeback_file_class->content_types) (TRACKER_WRITEBACK_FILE (writeback));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]