do not write htaccess file if disk space is too low#41544
Merged
Conversation
Contributor
Author
|
/backport to stable27 |
Contributor
|
Why? |
kesselb
reviewed
Nov 16, 2023
Contributor
Author
Because the file got truncated on @tobiasKaminsky's instance due to low disk space... |
Merged
tobiasKaminsky
approved these changes
Nov 17, 2023
Altahrim
reviewed
Nov 17, 2023
| } | ||
| } | ||
| //suppress errors in case we don't have permissions for it | ||
| return (bool)@file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent . $content . "\n"); |
Collaborator
There was a problem hiding this comment.
You can also check if all bytes have been written. Should be something like this:
Suggested change
| return (bool)@file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent . $content . "\n"); | |
| $fullContent = $htaccessContent . $content . "\n"; | |
| return @file_put_contents($setupHelper->pathToHtaccess(), $$fullContent) === strlen($fullContent); |
Contributor
Author
There was a problem hiding this comment.
This is not going to help here. The prpblem is that file_pu_content truncates the file if there is not enough space which should never happen as the file is very important to work...
Contributor
Author
There was a problem hiding this comment.
We had the same prpblem with config.php before and fixed in in the same way.
Collaborator
There was a problem hiding this comment.
It's another security in case something happen during the copy.
The file will already be erased, but at least you'll have the info
Altahrim
approved these changes
Nov 17, 2023
Signed-off-by: Simon L <szaimen@e.mail.de>
Signed-off-by: Simon L <szaimen@e.mail.de>
99a3dc6 to
3f6caa4
Compare
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I copied the logic from
server/lib/private/Config.php
Lines 288 to 295 in 1b18b97