X Tutup
Skip to content

fix: tear down the file system before setting up the file system for …#39518

Merged
DeepDiver1975 merged 1 commit intomasterfrom
fix/public-share-link-file-system-setup
Dec 1, 2021
Merged

fix: tear down the file system before setting up the file system for …#39518
DeepDiver1975 merged 1 commit intomasterfrom
fix/public-share-link-file-system-setup

Conversation

@DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Nov 22, 2021

…the share owner of a public share + more logging

Description

In some rare cases (observed in some shib setups) public links don't work properly.
This happens because the session holds the currently logged in user which is not the share owner.
As a result the file system could not be set up properly.

This PR adds logging and forces teardown of the file system before setting up the file system for the share owner.

Related Issue

How Has This Been Tested?

  • test environment: Unclear why this happen in one environment but not the other 🙈
  • see on an environment which uses shibboleth with ADFS
  • create public link on a folder
  • open link in browser where a different user then the share owner is logged in
  • see a white space instead of the file listing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@update-docs

This comment has been minimized.

…the share owner of a public share + more logging
@DeepDiver1975 DeepDiver1975 force-pushed the fix/public-share-link-file-system-setup branch from 8797459 to f3091c4 Compare November 22, 2021 16:30
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

4.8% 4.8% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

LGTM

SonarCloud requires some unit tests though, probably because of the changed imports.

@DeepDiver1975
Copy link
Member Author

Well .... That file is not unit testable ... 🤷

@JammingBen
Copy link
Contributor

Then @micbar has the mighty power the merge regardless of the SonarCloud result :)

@DeepDiver1975

This comment has been minimized.

@IljaN
Copy link
Contributor

IljaN commented Nov 23, 2021

The issue just popped up on another instance (also AD+shib ...) - patch was applied and fixed the issue.

Next questions:

  • will this happen now on all AD instances
  • release with 10.9

This instance has no shib, only AD

@micbar
Copy link
Contributor

micbar commented Nov 23, 2021

could that have performance implications?
We could test with cdperf.

@DeepDiver1975
Copy link
Member Author

could that have performance implications?

tearing down the fs is a fairly simple operation ... I can hardly imagine any impact.
I would still be great to find a way to not initialize the fs with the wrong user in the first place ;-)

I (or anybody else) could have a look into this if time permits ....

@IljaN
Copy link
Contributor

IljaN commented Nov 23, 2021

Stacktrace without shib ownCloud 10.8.04

User can't access public-links when logged in.
{"reqId":"YZy4L-8qBKL8-4bdX5Ee9AAAAAQ","level":0,"time":"2021-11-23T10:45:19+01:00","remoteAddr":"10.******","user":"--","app":"webdav","method":"PROPFIND","url":"\/public.php\/webdav\/","message":"Exception: HTTP\/1.1 404 Not Found: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ServerFactory.php(144): {closure}(*** sensitive parameters replaced ***)\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ServerFactory->OCA\\\\DAV\\\\Connector\\\\Sabre\\\\{closure}(*** sensitive parameters replaced ***)\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(456): Sabre\\\\DAV\\\\Server->emit()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(321): Sabre\\\\DAV\\\\Server->start()\\n#5 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(105): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/var\\\/www\\\/owncloud\\\/public.php(75): require_once('\\\/var\\\/www\\\/ownclo...')\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php\",\"Line\":85}"}

@DeepDiver1975
Copy link
Member Author

@IljaN please add these log lines to see if the fs is the issue:
https://github.com/owncloud/core/pull/39518/files#diff-881e8db59b87914234308a17ebb28970eca4e062bb15c3808456772738590b70R96-R100

THX

@IljaN
Copy link
Contributor

IljaN commented Nov 24, 2021

@DeepDiver1975 None of the log messages from this PR were fired after applying the Patch. Non the less the Patch fixes this. We tried to remove it again on a test-instance and logged-in pub shares were broken.

@DeepDiver1975
Copy link
Member Author

@DeepDiver1975 None of the log messages from this PR were fired after applying the Patch. Non the less the Patch fixes this. We tried to remove it again on a test-instance and logged-in pub shares were broken.

especially in the scenario where pub shares are broken I'd expect the log message.
Please only apply https://github.com/owncloud/core/pull/39518/files#diff-881e8db59b87914234308a17ebb28970eca4e062bb15c3808456772738590b70R96-R100 to get the log message.

Do not apply the rest of the patch.

@DeepDiver1975 DeepDiver1975 merged commit c33721d into master Dec 1, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix/public-share-link-file-system-setup branch December 1, 2021 09:50
@phil-davis
Copy link
Contributor

@DeepDiver1975 this is not in the release-10.9.0 branch.
Does it need to be released "soon" in 10.9.0?

@DeepDiver1975
Copy link
Member Author

Does it need to be released "soon" in 10.9.0?

no - thx

IljaN pushed a commit that referenced this pull request Dec 6, 2021
…the share owner of a public share + more logging (#39518)
@jnweiger
Copy link
Contributor

jnweiger commented May 11, 2022

Tested public links without shib.
Looks good in 10.10.0 RC2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

X Tutup