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
This commit is contained in:
Klaas Freitag 2015-09-09 14:12:13 +02:00
parent 02c077e3f8
commit df534753b1
2 changed files with 14 additions and 1 deletions

View file

@ -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) {

View file

@ -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 */