From: Claudio Cambra Date: Wed, 11 Sep 2024 06:18:15 +0000 (+0800) Subject: Wrap all uses of FileSystem::setFolderPermissions in ifdefs for macOS X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~20^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d1375281a214c3593008dd00f298870508ca4382;p=nextcloud-desktop.git Wrap all uses of FileSystem::setFolderPermissions in ifdefs for macOS Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index a938088cc..efb221c15 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1832,9 +1832,11 @@ 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); emit _discoveryData->remnantReadOnlyFolderDiscovered(item); +#endif return false; } else if (!item->isDirectory() && !perms.hasPermission(RemotePermissions::CanAddFile)) { qCWarning(lcDisco) << "checkForPermission: ERROR" << item->_file; @@ -2038,9 +2040,11 @@ 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); emit _discoveryData->remnantReadOnlyFolderDiscovered(_dirItem); +#endif } _dirItem->_direction = _dirItem->_direction == SyncFileItem::Up ? SyncFileItem::Down : SyncFileItem::Up;