Skip to content

Commit

Permalink
newly created folders will be read-only when needed
Browse files Browse the repository at this point in the history
Close #6296

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Jan 31, 2024
1 parent 06d8670 commit 871a02f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libsync/propagatorjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <qstack.h>
#include <QCoreApplication>

#include <filesystem>
#include <ctime>


Expand Down Expand Up @@ -188,6 +189,10 @@ void PropagateLocalMkdir::startLocalMkdir()
return;
}

if (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanAddFile) && !_item->_remotePerm.hasPermission(RemotePermissions::CanAddSubDirectories)) {
std::filesystem::permissions(newDirStr.toStdWString(), std::filesystem::perms::owner_write | std::filesystem::perms::group_write | std::filesystem::perms::owner_write, std::filesystem::perm_options::remove);
}

// Insert the directory into the database. The correct etag will be set later,
// once all contents have been propagated, because should_update_metadata is true.
// Adding an entry with a dummy etag to the database still makes sense here
Expand Down

0 comments on commit 871a02f

Please sign in to comment.