Discovery: don't ignore recall file #4420
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 8 Feb 2016 11:07:34 +0000 (12:07 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Mon, 8 Feb 2016 11:07:34 +0000 (12:07 +0100)
The ".sys.admin#recall#" is the recall file and should not be ignored
even if hidden.

The remote discovery do not need to detect hidden files because it
is already detected by csync in all cases. So this avoid code duplication

csync/src/csync_update.c
src/libsync/discoveryphase.cpp

index 90208d92a2ed5be762b7ae2a4d320083f7859c49..618c296b90b20e5fbafb9df4d8609a5a1483376b 100644 (file)
@@ -820,7 +820,9 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
      * local stat function.
      */
     if( d_name[0] == '.' ) {
-        dirent->flags |= CSYNC_VIO_FILE_FLAGS_HIDDEN;
+        if (strcmp(".sys.admin#recall#", d_name) != 0) { /* recall file shall not be ignored (#4420) */
+            dirent->flags |= CSYNC_VIO_FILE_FLAGS_HIDDEN;
+        }
     }
 
     if( res == 0) {
index 9c73e07f2d420790e188007fb57708c87a257dfd..dd001584388adac590db196cfa56115ffd86c33e 100644 (file)
@@ -325,9 +325,6 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(QString file, con
         if( slashPos > -1 ) {
             fileRef = file.midRef(slashPos+1);
         }
-        if( fileRef.startsWith(QChar('.')) ) {
-            file_stat->flags = CSYNC_VIO_FILE_FLAGS_HIDDEN;
-        }
         //qDebug() << "!!!!" << file_stat << file_stat->name << file_stat->file_id << map.count();
         _results.append(file_stat);
     }