Skip to content

Commit

Permalink
fix failing tests by using FileSystem::setFileReadOnlyWeak
Browse files Browse the repository at this point in the history
we try to preserve complex existing permissions unless the client is
required to change them significantly

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Jul 12, 2023
1 parent 505021a commit 845c666
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsync/propagatedownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ void PropagateDownloadFile::downloadFinished()
qCDebug(lcPropagateDownload()) << _tmpFile << "file is not locked: making it"
<< ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only"
: "read write");
FileSystem::setFileReadOnly(filename, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
FileSystem::setFileReadOnlyWeak(filename, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
}

// Apply the remote permissions
Expand Down Expand Up @@ -1355,7 +1355,7 @@ void PropagateDownloadFile::updateMetadata(bool isConflict)
FileSystem::setFileReadOnly(fn, true);
} else {
qCDebug(lcPropagateDownload()) << fn << "file is not locked: making it" << ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only" : "read write");
FileSystem::setFileReadOnly(fn, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
FileSystem::setFileReadOnlyWeak(fn, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
}

qint64 duration = _stopwatch.elapsed();
Expand Down

0 comments on commit 845c666

Please sign in to comment.