ignore encrypted items during discovery when encryption is disabled

when we know a folder should be encrypted but encryption client side app
is disabled, ignore any items in the encrypted folders

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-05-21 18:06:37 +02:00
parent a270dca344
commit 863256fd55
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553
2 changed files with 11 additions and 1 deletions

View file

@ -1664,6 +1664,13 @@ void ProcessDirectoryJob::processFileFinalize(
const SyncFileItemPtr &item, PathTuple path, bool recurse,
QueryMode recurseQueryLocal, QueryMode recurseQueryServer)
{
if (item->isEncrypted() && !_discoveryData->_account->capabilities().clientSideEncryptionAvailable()) {
item->_instruction = CSyncEnums::CSYNC_INSTRUCTION_IGNORE;
item->_direction = SyncFileItem::None;
emit _discoveryData->itemDiscovered(item);
return;
}
// Adjust target path for virtual-suffix files
if (isVfsWithSuffix()) {
if (item->_type == ItemTypeVirtualFile) {

View file

@ -623,10 +623,13 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithoutErrorSlot()
emit finished(HttpError{ 0, _error });
deleteLater();
return;
} else if (isE2eEncrypted()) {
} else if (isE2eEncrypted() && _account->capabilities().clientSideEncryptionAvailable()) {
emit etag(_firstEtag, QDateTime::fromString(QString::fromUtf8(_lsColJob->responseTimestamp()), Qt::RFC2822Date));
fetchE2eMetadata();
return;
} else if (isE2eEncrypted() && !_account->capabilities().clientSideEncryptionAvailable()) {
emit etag(_firstEtag, QDateTime::fromString(QString::fromUtf8(_lsColJob->responseTimestamp()), Qt::RFC2822Date));
emit finished(_results);
}
emit etag(_firstEtag, QDateTime::fromString(QString::fromUtf8(_lsColJob->responseTimestamp()), Qt::RFC2822Date));
emit finished(_results);