Skip to content

Commit

Permalink
Mark read-only files as read-only on the filesystem. owncloud#3244
Browse files Browse the repository at this point in the history
  • Loading branch information
ckamm committed May 27, 2015
1 parent 2435ba7 commit 1960dc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libsync/propagatedownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,17 @@ void PropagateDownloadFileQNAM::downloadFinished()
}
}

// Make the file read-only if it's read-only on the server.
if (!_item._remotePerm.contains("W")) {
qDebug() << "READ ONLY" << fn;
QFile::Permissions perms = _tmpFile.permissions();
perms &= ~QFile::WriteOwner;
perms &= ~QFile::WriteUser;
perms &= ~QFile::WriteGroup;
perms &= ~QFile::WriteOther;
_tmpFile.setPermissions(perms);
}

QString error;
_propagator->addTouchedFile(fn);
// The fileChanged() check is done above to generate better error messages.
Expand Down

0 comments on commit 1960dc4

Please sign in to comment.