Don't make files read-only when server is too old #4450

This commit is contained in:
Christian Kamm 2016-03-01 10:11:20 +01:00
parent 3f462403a9
commit a9b00a7489

View file

@ -691,8 +691,13 @@ void PropagateDownloadFileQNAM::downloadFinished()
}
// Apply the remote permissions
FileSystem::setFileReadOnlyWeak(_tmpFile.fileName(),
!_item->_remotePerm.contains('W'));
// Older server versions sometimes provide empty remote permissions
// see #4450 - don't adjust the write permissions there.
const int serverVersionGoodRemotePerm = 0x070000; // 7.0.0
if (_propagator->account()->serverVersionInt() >= serverVersionGoodRemotePerm) {
FileSystem::setFileReadOnlyWeak(_tmpFile.fileName(),
!_item->_remotePerm.contains('W'));
}
QString error;
_propagator->addTouchedFile(fn);