[tracker/sam/functional-test-fixes: 10/30] tracker-writeback: Remove broken code to set file attributes



commit 86ec2b944043185fcc497aa930ace416ab1b83e1
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Jul 26 17:22:07 2014 +0200

    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 UNIX permissions of the
    file after tracker-writeback rewrites it. The code already takes
    icare of this at the time the temporary file is created.

 src/tracker-writeback/tracker-writeback-file.c |   12 +++---------
 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 f00d668..60fc250 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);


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