]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
local_vio_win: Fix handling files that have been deduplicated
authorKlaas Freitag <freitag@owncloud.com>
Wed, 20 Apr 2016 12:15:38 +0000 (14:15 +0200)
committerKlaas Freitag <freitag@owncloud.com>
Thu, 21 Apr 2016 15:38:43 +0000 (17:38 +0200)
as part of Windows SIS or Data Deduplication. Fixes #4056

csync/src/vio/csync_vio_local_win.c

index 7bf403315a399709c188b5c0a0ecf69a324aa21d..f43393ea4c2f1b01f1d45b1b17e9dc39fad1a9bf 100644 (file)
@@ -168,9 +168,14 @@ csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
   }
   file_stat->name = c_utf8_from_locale(handle->ffd.cFileName);
 
-  file_stat->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
-  if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT
-            && handle->ffd.dwReserved0 & IO_REPARSE_TAG_SYMLINK) {
+    file_stat->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
+    if ( (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+         && (handle->ffd.dwReserved0 & IO_REPARSE_TAG_SYMLINK)
+         // The SIS or DEDUP flag points to a MS deduplication feature of
+         // certain file storage products. It is not a normal symlink
+         // that should be ignored.
+         && (! (handle->ffd.dwReserved0 & IO_REPARSE_TAG_SIS))
+         && (! (handle->ffd.dwReserved0 & IO_REPARSE_TAG_DEDUP)) ) {
         file_stat->flags = CSYNC_VIO_FILE_FLAGS_SYMLINK;
         file_stat->type = CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK;
     } else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE