-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Return proper error if part file name is too long #39168
Conversation
@mrow4a @DeepDiver1975 As discussed, here is the alternative approach for our part file name issue. Please have a look. |
Please note that by setting |
I see no change from 255 to 250 in this pr. |
Changing this won't affect anything, because the part file is being written to the filesystem before the length check of the original file. Thus we just added a length check for the part file itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add quick unit test
💥 Acceptance tests pipeline apiProvisioning-v1-mariadb10.2-php7.4 failed. The build has been cancelled. |
https://drone.owncloud.com/owncloud/core/32163
https://drone.owncloud.com/owncloud/core/32163/32/10
These are both errors when running with I am not sure how you can get the file system max filename length from within PHP. If you could do that, then the test could generate a filename a bit longer than the maximum allowed by the current storage. Or maybe tag this test case to skip on scality (however that is done in the unit tests). |
71b5543
to
2ebdb1a
Compare
Maybe this can help a bit... |
This is not the issue I think as the character limit is hard coded: https://github.com/owncloud/core/blob/master/lib/private/Files/Storage/Common.php#L507. It rather seems that the scality storage does not use part files at all, therefore no exception. Let's see if it succeeds now. |
Kudos, SonarCloud Quality Gate passed! |
All the failing CI in oC10 apps is passing now. This core change was "a good thing". |
Tested with owncloud core 10.9.0 beta1Using the web client: 228 characters is the limit on my testsystem. A file with 229 chars triggers a "filename too long" error. OKayish. |
Description
This is an alternative, less destructive approach than #39088.
With this implementation, we keep the filename limit for part file names and just return a proper error. That means, if you upload a file with 250 chars (filesystem limit is usually 255), then you still get an "filename too long" error because of the part file name added by ownCloud.
This PR also reverts #39088 therefore.
Related Issue
Screenshots (if appropriate):
Types of changes
Checklist: