summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2014-07-26 17:22:07 +0200
committerSam Thursfield <sam@afuera.me.uk>2014-10-14 14:08:20 +0100
commit85666d5dc1e662be783707d4186f4b3019074cb9 (patch)
tree3ae8b92795fd5b5004266d8102f5cf91f36e25e0
parent30b81521751406d8a8074d2306194c86d730337f (diff)
downloadtracker-85666d5dc1e662be783707d4186f4b3019074cb9.tar.gz
tracker-writeback: Remove broken code to set file attributes
Remove some code which tries to set attributes of a file which no longer exists. This code was added in the following commit: commit 16fe51de1e93016a122ab089b0e0201c18de7ebc Author: Philip Van Hoof <philip@codeminded.be> Date: Wed Nov 9 12:56:59 2011 +0100 tracker-writeback: Preserve file permissions Fixes NB#289953. Seems that the intent was to preserve the permission bits of the file after tracker-writeback rewrites it. The code already takes care of this at the time the temporary file is created.
-rw-r--r--src/tracker-writeback/tracker-writeback-file.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/tracker-writeback/tracker-writeback-file.c b/src/tracker-writeback/tracker-writeback-file.c
index f00d6685a..60fc250e5 100644
--- a/src/tracker-writeback/tracker-writeback-file.c
+++ b/src/tracker-writeback/tracker-writeback-file.c
@@ -257,18 +257,12 @@ tracker_writeback_file_update_metadata (TrackerWriteback *writeback,
/* Delete the temporary file and preserve original */
g_file_delete (tmp_file, NULL, NULL);
} else {
- GError *m_error = NULL;
- /* Move back the modified file to the original location */
+ /* Move back the modified file to the original location. Correct UNIX
+ * mode has been set for tmp_file in create_temporary_file() already.
+ */
g_file_move (tmp_file, file,
G_FILE_COPY_OVERWRITE,
NULL, NULL, NULL, NULL);
- /* Set file attributes on tmp_file using file_info of original file */
- g_file_set_attributes_from_info (tmp_file, file_info, 0, NULL, &m_error);
- if (m_error) {
- g_warning ("Can't restore permissions of original file for %s",
- row[0]);
- g_error_free (m_error);
- }
}
g_object_unref (file_info);