-
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
Prevent 507 Insufficient Storage on 32-bit systems #40709
Conversation
Can't test this now. But I think the original code with the (int) cast should be in the "else" clause of the PHP_INT_SIZE test or the overflow and the incorrect error will still happen. |
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM now. There is code duplication, but minimizing that might obfuscate the separate 32-bit and not-32-bit code blocks.
Manual testing in #40695 seems to confirm this solves the issue. |
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.
I am not 100% convinced, all edge cases are covered. But as the immediate problem of the user is nicely fixed. I am happy with the solution too.
As in "there could be more issues caused by integer overflow in 32 bits"?. Yeah, probably. If it isn't officially supported and we aren't testing with 32 bits, there could be issues lurking around. |
I changed apps/dav/lib/Connector/Sabre/QuotaPlugin.php still having this issue : there is insufficient space available on the server for some upload. Nothing have changed even with your new code. No idea why it doesn't work properly. |
If you're using a 32 bit system, you might still be limited to uploads of less than 2GB. I'm not sure about the exact behavior, but there could be issues. |
@pako81 we might need a different fix. It seems that the
That's "consistency" in PHP.... I think the reproduction steps should be:
Maybe it works for 64 bits because the bigint coming from the DB fits in a 64 bits integer I think we'll have to keep the "32 bits block" and remove the other one. Need to check all the places where the |
It's not from the quotas for sure and even when I put a single photo, it told me I don't have any space left |
@Valentin-Bleuse we might need a new ticket for that. I'd recommend you to try to reproduce the issue either in a fresh environment or in https://demo.owncloud.com . It might be a different issue, and without steps to reproduce we can't fix the problem. In addition, make sure you have enough space everywhere:
|
Description
Prevent 507 Insufficient Storage on 32-bit systems
Related Issue
Motivation and Context
With the introduction of c368786 we apparently broke compatibility to 32-bit systems as we are now casting
$freeSpace
to int and this is causing an integer overflow on such systems when the free space is above the max supported value. We added therefore an additional check for 32-bit systems in QuotaPlugin.php.How Has This Been Tested?
Types of changes
Checklist: