[Pkg-owncloud-commits] [owncloud-client] 73/218: csync_update: Handle permission denied as soft error in discovery.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 17 14:30:47 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 df534753b171f0b714221397e15a0f8e094bdeaf
Author: Klaas Freitag <freitag at owncloud.com>
Date: Wed Sep 9 14:12:13 2015 +0200
csync_update: Handle permission denied as soft error in discovery.
For that, treat the not accessible directory as if it were ignored.
This will fix #3767
---
csync/src/csync_update.c | 11 ++++++++++-
src/libsync/syncengine.cpp | 4 ++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index 9d347b3..8b9a4b9 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -630,7 +630,16 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
/* permission denied */
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_OPENDIR_ERROR);
if (errno == EACCES) {
- return 0;
+ if (ctx->current_fs) {
+ ctx->current_fs->instruction = CSYNC_INSTRUCTION_IGNORE;
+ ctx->current_fs->error_status = CSYNC_STATUS_PERMISSION_DENIED;
+ /* If a directory has ignored files, put the flag on the parent directory as well */
+ if( previous_fs ) {
+ previous_fs->has_ignored_files = true;
+ }
+ }
+ goto done;
+ // previously return 0;
} else if(errno == ENOENT) {
asp = asprintf( &ctx->error_string, "%s", uri);
if (asp < 0) {
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 62f6c10..d6b7a64 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -414,6 +414,10 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
item->_status = SyncFileItem::SoftError;
_temporarilyUnavailablePaths.insert(item->_file);
break;
+ case CSYNC_STATUS_PERMISSION_DENIED:
+ item->_errorString = QLatin1String("Directory not accessible on client, permission denied.");
+ item->_status = SyncFileItem::SoftError;
+ break;
default:
Q_ASSERT("Non handled error-status");
/* No error string */
--
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