Skip to content

Conversation

@PhrozenByte
Copy link
Member

Nextcloud's file operations API apparently is unable to proberly deal with relative paths (even though the docs tell us otherwise). It …

  1. performs file permission checks on the base directory rather than the respective parent directory (:confused:), causing problems with local external storage? #141, and
  2. blocks relative paths like .. (likely as a security measure - by using the most unsophisticated approach 😒).

Also see nextcloud/server#26396.

Fixes #141 #165

@szaimen @matrois: Since I still don't know what exactly you guys are doing to cause this issue, I couldn't test it. Please give it a try.

Nextcloud's file operations API apparently is unable to proberly deal with relative paths (even though the docs tell us otherwise). It (a) performs file permission checks on the base directory rather than the respective parent directory (:confused:), and (b) blocks relative paths like '..' (likely as a security measure - by using the most unsophisticated approach :unamused:). Also see nextcloud/server#26396. We better do this on our own...

Fixes #141

Signed-off-by: Daniel Rudolf <[email protected]>
@szaimen
Copy link

szaimen commented Apr 2, 2021

Unfortunately I cannot test this since I get

error: patch failed: lib/Files/LocalFolder.php:153
error: lib/Files/LocalFolder.php: patch does not apply

when I try to apply the patch...

@szaimen
Copy link

szaimen commented Apr 2, 2021

@PhrozenByte if you want to test this yourself you should be able to reproduce this issue by following:

  1. Make your Nextcloud root folder read only by mounting a local external storage to Nextcloud, making it read only and naming it /.
  2. Create a second local external storage, name it differently and make it writeable.
  3. try to create a new website in the second local external storage with the cms_pico app

@PhrozenByte
Copy link
Member Author

No need to apply the patch manually, simply clone the branch (or download the source ZIP from https://github.com/nextcloud/cms_pico/archive/refs/heads/bugfix/141.zip) and run composer install.

@szaimen
Copy link

szaimen commented Apr 2, 2021

Thanks! I've done that in a VM and I can report that it fixes my issues with read only root folder. Thank you! :)

Signed-off-by: Daniel Rudolf <[email protected]>
@PhrozenByte
Copy link
Member Author

Let's give @matrois a few more days to test this, too.

Signed-off-by: Daniel Rudolf <[email protected]>
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.

problems with local external storage?

3 participants