Permissions: Consider and empty remotePerms from csync as NULL

Since remotePerm from csync is never NULL (as it is a buffer),
we consider that if it is empty, there was no permission set
(and therefore everything is allowed)

csync will put a space in the permission if any permission was set
This commit is contained in:
Olivier Goffart 2014-06-23 15:05:48 +02:00
parent 68c902e60b
commit b735dc07d6

View file

@ -273,14 +273,14 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
if (file->directDownloadCookies) {
item._directDownloadCookies = QString::fromUtf8( file->directDownloadCookies );
}
if (file->remotePerm) {
if (file->remotePerm && file->remotePerm[0]) {
item._remotePerm = QByteArray(file->remotePerm);
}
// record the seen files to be able to clean the journal later
_seenFiles.insert(item._file);
if (remote && file->remotePerm) {
if (remote && file->remotePerm && file->remotePerm[0]) {
_remotePerms[item._file] = file->remotePerm;
}