Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newly created folders will be read-only when needed #6343

Merged
merged 10 commits into from
Mar 12, 2024

Conversation

mgallien
Copy link
Collaborator

Close #6296

@mgallien
Copy link
Collaborator Author

not ready
more like a proof of concept

@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch from e767bbc to b724221 Compare January 24, 2024 13:23
@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch 9 times, most recently from b5f7fdd to cd6413b Compare February 7, 2024 11:26
@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch 2 times, most recently from d5bc5cd to 62d3388 Compare February 9, 2024 14:23
@mgallien
Copy link
Collaborator Author

windows build https://cloud.nextcloud.com/s/GPFmNcrTsoFqF4q

@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch 2 times, most recently from 43480d6 to 3a8167e Compare February 19, 2024 17:13
@blizzz
Copy link
Member

blizzz commented Feb 20, 2024

fyi, you need to update the signature in .drone.yml, otherwise drone will just wait for manual approval of the ci run,

src/libsync/filesystem.h Outdated Show resolved Hide resolved
src/libsync/filesystem.cpp Show resolved Hide resolved
test/testpermissions.cpp Outdated Show resolved Hide resolved
test/testpermissions.cpp Outdated Show resolved Hide resolved
src/libsync/propagatedownload.h Outdated Show resolved Hide resolved
src/libsync/propagatorjobs.cpp Outdated Show resolved Hide resolved
src/libsync/propagatorjobs.cpp Outdated Show resolved Hide resolved
src/libsync/propagatedownload.cpp Outdated Show resolved Hide resolved
@allexzander
Copy link
Contributor

@mgallien drone compilation is broken, btw, unused parameter

@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch 4 times, most recently from 8185df1 to 040c00a Compare February 23, 2024 09:41
@mgallien
Copy link
Collaborator Author

latest build for windows https://cloud.nextcloud.com/s/E9LtgzR8zkrPabL

@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch 3 times, most recently from 3cab70f to 64e2b99 Compare March 7, 2024 15:14
src/libsync/filesystem.cpp Outdated Show resolved Hide resolved
src/libsync/filesystem.cpp Show resolved Hide resolved
}
catch (const std::filesystem::filesystem_error &e)
{
qCWarning(lcPropagateDownload) << "exception when checking parent folder access rights" << e.what() << e.path1().c_str() << e.path2().c_str();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgallien What I really don't like is that we are using std::filesystem exceptions here on this level, while we never had them before in the sync engine. I would suggest handling them in the utility source files when possible. The code here now looks much more complicated if you just want to read the PropagateDownload job logic.

Besides, you don't have any logic in these catch blocks just a log.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you want to be forbid using std::filesystem APIs ?
constructors of std::filesystem::path can throw
what do you suggest ?
not using this type ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgallien No, using unified way of error processing in our API, and moving try/catch blocks of std::filesystem::path into our framework, like you id already in filesyste.cpp, then on the outside, from our API you can return an error message for example, or an optional that we already have for a result error is set or not, and if set, then there is an error message. But it is up to you. My motivation is to keep PropagateItem jobs more simple and easier to read. We have so much logic there.

src/libsync/propagatedownload.cpp Outdated Show resolved Hide resolved
@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch 2 times, most recently from d4387d6 to 0c0d306 Compare March 11, 2024 14:52
@allexzander allexzander self-requested a review March 11, 2024 16:05
return false;
}

securityDescriptor.reset(new char[neededLength]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgallien you could've used std::vector<char>::resize()

@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch from 0c0d306 to 3c52a8b Compare March 11, 2024 16:43
@mgallien mgallien force-pushed the feature/applyPermissionsFromServerToFolders branch from 3c52a8b to ff9953b Compare March 12, 2024 22:30
@mgallien mgallien merged commit 61251cd into master Mar 12, 2024
9 of 12 checks passed
@mgallien mgallien deleted the feature/applyPermissionsFromServerToFolders branch March 12, 2024 22:30
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-6343-ff9953b36b5644ec751682687f7257fe9cedfb2b-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

Copy link

sonarcloud bot commented Mar 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@mgallien
Copy link
Collaborator Author

/backport b0a2d5f to stable-3.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Desktop respect file/folder permissions on shares / groupfolders
4 participants