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 <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Jan 24, 2024
1 parent de87864 commit b724221
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
@@ -32,6 +32,7 @@
#include <qstack.h>
#include <QCoreApplication>

#include <filesystem>
#include <ctime>


@@ -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

0 comments on commit b724221

Please sign in to comment.