[Pkg-owncloud-commits] [owncloud-client] 74/164: Inform user about ignored long files. #2882

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:56:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit b03209ccef115eaee505d75648197bf1f0666474
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Fri Feb 27 11:25:03 2015 +0100

    Inform user about ignored long files. #2882
---
 csync/src/csync.h          |  1 +
 csync/src/csync_exclude.c  | 11 +++++++++--
 csync/src/csync_exclude.h  |  3 ++-
 csync/src/csync_update.c   |  2 ++
 src/gui/socketapi.cpp      |  3 ++-
 src/libsync/syncengine.cpp |  3 +++
 6 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/csync/src/csync.h b/csync/src/csync.h
index 5bca3c9..a3c490e 100644
--- a/csync/src/csync.h
+++ b/csync/src/csync.h
@@ -105,6 +105,7 @@ enum csync_status_codes_e {
     CSYNC_STATUS_INDIVIDUAL_IS_HARDLINK,
     CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST,
     CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS,
+    CSYNC_STATUS_INDIVIDUAL_EXCLUDE_LONG_FILENAME,
     CYSNC_STATUS_FILE_LOCKED_OR_OPEN
 };
 
diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c
index 583aebe..198389a 100644
--- a/csync/src/csync_exclude.c
+++ b/csync/src/csync_exclude.c
@@ -224,14 +224,21 @@ CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path
   }
 
   rc = csync_fnmatch(".csync_journal.db*", bname, 0);
-  // check the strlen and ignore the file silently if its name is longer than 254 chars.
-  if (strlen(bname) > 254 || rc == 0) {
+  if (rc == 0) {
       match = CSYNC_FILE_SILENTLY_EXCLUDED;
       SAFE_FREE(bname);
       SAFE_FREE(dname);
       goto out;
   }
 
+  // check the strlen and ignore the file if its name is longer than 254 chars.
+  if (strlen(bname) > 254) {
+      match = CSYNC_FILE_EXCLUDE_LONG_FILENAME;
+      SAFE_FREE(bname);
+      SAFE_FREE(dname);
+      goto out;
+  }
+
 #ifdef _WIN32
   // Windows cannot sync files ending in spaces (#2176). It also cannot
   // distinguish files ending in '.' from files without an ending,
diff --git a/csync/src/csync_exclude.h b/csync/src/csync_exclude.h
index efc809f..329d957 100644
--- a/csync/src/csync_exclude.h
+++ b/csync/src/csync_exclude.h
@@ -26,7 +26,8 @@ enum csync_exclude_type_e {
   CSYNC_FILE_SILENTLY_EXCLUDED,
   CSYNC_FILE_EXCLUDE_AND_REMOVE,
   CSYNC_FILE_EXCLUDE_LIST,
-  CSYNC_FILE_EXCLUDE_INVALID_CHAR
+  CSYNC_FILE_EXCLUDE_INVALID_CHAR,
+  CSYNC_FILE_EXCLUDE_LONG_FILENAME
 };
 typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
 
diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index f966309..fdb6df9 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -416,6 +416,8 @@ out:
       st->error_status = CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST; /* File listed on ignore list. */
     } else if (excluded == CSYNC_FILE_EXCLUDE_INVALID_CHAR) {
       st->error_status = CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS;  /* File contains invalid characters. */
+    } else if (excluded == CSYNC_FILE_EXCLUDE_LONG_FILENAME) {
+      st->error_status = CSYNC_STATUS_INDIVIDUAL_EXCLUDE_LONG_FILENAME; /* File name is too long. */
     }
   }
   if (st->instruction != CSYNC_INSTRUCTION_NONE && st->instruction != CSYNC_INSTRUCTION_IGNORE
diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index 0856f2c..b66fced 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -55,7 +55,8 @@ enum csync_exclude_type_e {
   CSYNC_FILE_SILENTLY_EXCLUDED,
   CSYNC_FILE_EXCLUDE_AND_REMOVE,
   CSYNC_FILE_EXCLUDE_LIST,
-  CSYNC_FILE_EXCLUDE_INVALID_CHAR
+  CSYNC_FILE_EXCLUDE_INVALID_CHAR,
+  CSYNC_FILE_EXCLUDE_LONG_FILENAME
 };
 typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
 
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 35ebca2..b7b769c 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -368,6 +368,9 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
     case CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS:
         item._errorString = tr("File contains invalid characters that can not be synced cross platform.");
         break;
+    case CSYNC_STATUS_INDIVIDUAL_EXCLUDE_LONG_FILENAME:
+        item._errorString = tr("Filename is too long.");
+        break;
     case CYSNC_STATUS_FILE_LOCKED_OR_OPEN:
         item._errorString = QLatin1String("File locked"); // don't translate, internal use!
         break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list