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

Only use realpath for real directories #26058

Merged
merged 1 commit into from
Sep 8, 2016

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented Sep 7, 2016

Description

In some cross-local-storage use cases, the Local storage is
instantiated with "/" as data directory. In such cases, calling
realpath() would cause PHP warnings when open_basedir is set.

This fix bypasses the realpath() call when dealing with a root storage.

This occurs mostly when overwriting files with Webdav because it will trigger the version code's version copying which is internally a cross-storage copy apparently.

Related Issue

Fixes #26033

Motivation and Context

See issue, mostly a PHP warning

How Has This Been Tested?

See steps in issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

(can't really automatically test due to calling PHP system function)

Backports

  • stable9.1
  • stable9
  • stable8.2

Please review @owncloud/filesystem @timreeves @DeepDiver1975 @butonic

In some cross-local-storage use cases, the Local storage is
instantiated with "/" as data directory. In such cases, calling
realpath() would cause PHP warnings when open_basedir is set.

This fix bypasses the realpath() call when dealing with a root storage.
@PVince81 PVince81 added this to the 9.2 milestone Sep 7, 2016
@mention-bot
Copy link

@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @icewind1991, @DeepDiver1975 and @nickvergessen to be potential reviewers

@guruz
Copy link
Contributor

guruz commented Sep 7, 2016

👍

1 similar comment
@butonic
Copy link
Member

butonic commented Sep 7, 2016

👍

@timreeves
Copy link

timreeves commented Sep 7, 2016

Thanks to @PVince81. I confirm that the code fix (which I manually copied into my 9.1.0) does work - for my case at least - at last no more such entries in my OC log! Oh yes - and it would be great if the fix will be in 9.1.1.

@PVince81
Copy link
Contributor Author

PVince81 commented Sep 7, 2016

Hmm I was wrong about the backports, seems only OC 9.1 is affected.
Well, the root dir does exist in older versions, but the realpath call doesn't.

@PVince81
Copy link
Contributor Author

PVince81 commented Sep 7, 2016

stable9.1: #26060

@DeepDiver1975 can you kick/boot/reboot/... Jenkins ? Still the mysql error

@DeepDiver1975 DeepDiver1975 merged commit 0751c2e into master Sep 8, 2016
@DeepDiver1975 DeepDiver1975 deleted the fix-openbasedir-realpath-warning branch September 8, 2016 10:11
LukasReschke pushed a commit to nextcloud/server that referenced this pull request Sep 26, 2016
In some cross-local-storage use cases, the Local storage is
instantiated with "/" as data directory. In such cases, calling
realpath() would cause PHP warnings when open_basedir is set.

This fix bypasses the realpath() call when dealing with a root storage.

Downstreaming of owncloud/core#26058

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
@lock
Copy link

lock bot commented Aug 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9.1.0: realpath error messages in OC log although file uploads succeed
6 participants