Fix #5317: Change file attributes before modifying file time.
authorArmin Novak <armin.novak@thincast.com>
Fri, 29 Mar 2019 14:45:38 +0000 (15:45 +0100)
committerArmin Novak <armin.novak@thincast.com>
Fri, 29 Mar 2019 14:45:52 +0000 (15:45 +0100)
channels/drive/client/drive_file.c

index 0b5a707..000126c 100644 (file)
@@ -590,13 +590,13 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
 
                        DEBUG_WSTR("SetFileTime %s", file->fullpath);
 
+                       SetFileAttributesW(file->fullpath, FileAttributes);
                        if (!SetFileTime(file->file_handle, pftCreationTime, pftLastAccessTime, pftLastWriteTime))
                        {
                                WLog_ERR(TAG, "Unable to set file time to %s", file->fullpath);
                                return FALSE;
                        }
 
-                       SetFileAttributesW(file->fullpath, FileAttributes);
                        break;
 
                case FileEndOfFileInformation: