avoid fread on directories and unencrypted files#24966
Conversation
Reworking the logic in order to first check the filecache and only then reading the fileheader. This in order to solve #21578.
|
@nextcloud/encryption Pls review. Also check the discussion of the issue I posted in #21578. That said, I didn't yet find out why this function is evaluated very often for keyfiles. |
|
Signed-off-by: Jasper Knockaert jasper@knockaert.nl |
|
Can anyone help with the testing? It is my understanding that in the tests the call to the cache was never evaluated, so I guess that should somewhere be caught now that it comes first. |
|
OK, with all checks passed now I think this one is ready for review. As for the |
|
@jknockaert I applied the below fix and im not getting the errors anymore |
|
I dont know what this is doing, nor am I a nextcloud maintainer. |
Signed-off-by: Jasper Knockaert jasper@knockaert.nl
|
@RedKage Thanks; fixed. |
|
@ChristophWurst Any suggestion who to invite for a review? |
|
@nextcloud/encryption Can anyone review? This is a fairly minor patch that fixes errors with php7.4. It would be good to have it included in the next point release of nextcloud. |
|
Have applied changes manually, and so far everything looks fine. |
|
Can anyone review? This is a minor (and straightforward) patch that fixes errors with php7.4. It would be good to have it included in the next point release of nextcloud. |
This comment has been minimized.
This comment has been minimized.
If the test passes, what's wrong? :-) |
vitormattos
left a comment
There was a problem hiding this comment.
It seems to be ok, there seems to be no need to create new test scenarios.
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
Thanks @vitormattos and @icewind1991 for the reviews. |
This comment has been minimized.
This comment has been minimized.
|
It is in the same class but does not seem to be related to this pull request. Looking at the log quickly, without a thorough analysis, the method changed in this pull request is not in the callstack of the log you posted. |
This comment has been minimized.
This comment has been minimized.
|
I suggest sending a new pull request solving this problem :) The solution is already described in the log, it is necessary to implement, check the impacts, review the unit tests to ensure they are ok and send the pull request. |
|
I just did! i tagged you in it so maybe we can have someone look at it quicker :) |
|
You have opened an issue. Submit the pull request with the solution. The correction is simple, but it is necessary to check the impacts well. |
|
@vitormattos i would not know the solutions i don't code. maybe @jknockaert knows it but i dont |
|
@axheli Pls tag me. I may have time to have a look at it over the weekend. |
|
|
@jknockaert Thank you so much :) |
|
Still an issue on Nextcloud 21.0.2 @LukasReschke can we please add this fix ? |
|
/backport to stable21 |
|
/backport to stable20 |
|
/backport to stable19 |
|
Hello everyone is anybody willing to add this fix to the Next release 21.0.4 ? |

Reworking the logic in order to first check the filecache and only then reading the fileheader.
This in order to solve #21578.
Signed-off-by: Jasper Knockaert jasper@knockaert.nl