Skip to content

Commit

Permalink
Merge pull request #7099 from nextcloud/backport/7098/stable-3.13
Browse files Browse the repository at this point in the history
[stable-3.13] Fix building of client on macOS 10.13 and 10.14
  • Loading branch information
claucambra authored Sep 11, 2024
2 parents 70814f8 + 2c3884b commit 0f5c0e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,8 +1780,10 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
item->_instruction = CSYNC_INSTRUCTION_ERROR;
item->_errorString = tr("Not allowed because you don't have permission to add subfolders to that folder");
const auto localPath = QString{_discoveryData->_localDir + item->_file};
#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
qCWarning(lcDisco) << "unexpected new folder in a read-only folder will be made read-write" << localPath;
FileSystem::setFolderPermissions(localPath, FileSystem::FolderPermissions::ReadWrite);
#endif
return false;
} else if (!item->isDirectory() && !perms.hasPermission(RemotePermissions::CanAddFile)) {
qCWarning(lcDisco) << "checkForPermission: ERROR" << item->_file;
Expand Down Expand Up @@ -1984,8 +1986,10 @@ int ProcessDirectoryJob::processSubJobs(int nbJobs)
_dirItem->_instruction = CSYNC_INSTRUCTION_ERROR;
_dirItem->_errorString = tr("Not allowed because you don't have permission to add subfolders to that folder");
const auto localPath = QString{_discoveryData->_localDir + _dirItem->_file};
#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
qCWarning(lcDisco) << "unexpected new folder in a read-only folder will be made read-write" << localPath;
FileSystem::setFolderPermissions(localPath, FileSystem::FolderPermissions::ReadWrite);
#endif
}

_dirItem->_direction = _dirItem->_direction == SyncFileItem::Up ? SyncFileItem::Down : SyncFileItem::Up;
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/propagatorjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ void PropagateLocalRename::start()
qCWarning(lcPropagateLocalRename) << "exception when checking parent folder access rights" << e.what() << e.path1().c_str() << e.path2().c_str();
}
};
#endif

const auto folderPermissionsHandler = FileSystem::FilePermissionsRestore{existingFile, FileSystem::FolderPermissions::ReadWrite};
#endif

emit propagator()->touchedFile(existingFile);
emit propagator()->touchedFile(targetFile);
Expand Down

0 comments on commit 0f5c0e7

Please sign in to comment.