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

fix(files_versions): Check for user and owner before call getUserFolder #41749

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

solracsf
Copy link
Member

@solracsf solracsf commented Nov 25, 2023

Explicitly check both values to avoid false or null values being passed to getUserFolder() calls.

[files] Error: OC\User\NoUserException: Backends provided no user object at <<closure>>

 0. <<closure>>
    OC\Files\Node\Root->getUserFolder(false)
 1. /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 73
    call_user_func_array([["OC\\Files\\No ... "], [false])
 2. /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php line 40
    OC\Files\Node\LazyFolder->__call("getUserFolder", [false])
 3. /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php line 357
    OC\Files\Node\LazyRoot->getUserFolder(false)
...

Checklist

@solracsf solracsf added the 3. to review Waiting for reviews label Nov 25, 2023
@solracsf solracsf added this to the Nextcloud 29 milestone Nov 25, 2023
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

Thanks for the change :).
One comment through.

apps/files_versions/lib/Listener/FileEventsListener.php Outdated Show resolved Hide resolved
…etUserFolder

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Fix typo

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Fix

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Fix

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Fix

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Optimize DI

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Switch to DI

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

userSession does not contain null

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Restore phpdoc annots

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

👌

@artonge artonge requested a review from Altahrim November 27, 2023 14:28
@susnux susnux merged commit 5d669ab into master Nov 27, 2023
50 checks passed
@susnux susnux deleted the checkUserOwner branch November 27, 2023 18:16
@susnux
Copy link
Contributor

susnux commented Nov 27, 2023

backport to 28?

@solracsf
Copy link
Member Author

/backport to stable28

@solracsf
Copy link
Member Author

/backport to stable27

@solracsf
Copy link
Member Author

/backport to stable26

@blizzz
Copy link
Member

blizzz commented Dec 5, 2023

may need it backport to 26 as well?

Just seeing it was attempted to be triggered on the 27 backport

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

Successfully merging this pull request may close these issues.

5 participants