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

external storage: broken file access #3644

Closed
XueSheng-GIT opened this issue Jun 9, 2013 · 5 comments
Closed

external storage: broken file access #3644

XueSheng-GIT opened this issue Jun 9, 2013 · 5 comments

Comments

@XueSheng-GIT
Copy link

Expected behaviour

Download of files and e.g. preview of pictures should work for local and external storage.

Actual behaviour

Download of files which are mounted through external storage app results in an error:

Not Found

The requested URL /owncloud/index.php/apps/files/ajax/download.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.22 (Ubuntu) Server at mycloud Port 443

Clicking on a jpg files gives the following error:

The requested content cannot be loaded.
Please try again later.

Steps to reproduce

  1. create a folder e.g. /mnt/external_storage
  2. change user:group so that owncloud users gain access, e.g. chmod -R www-data:www-data /mnt/external_storage
  3. Login into admin account of owncloud and activate the "external storage" app.
  4. Goto administrator settings and setup external storage:
    • foldername: external_storage
    • type: local
    • path: /mnt/external_storage
    • user/group according to your setup needs
  5. Login into regular user account (which was specified in step 3)
  6. access external_storage, create a text file 'Textfile.txt' and save it.
  7. Click download button.
  8. Error msg 'Not Found' appears (see actual behaviour above).
  9. Upload a jpg file to external_storage.
  10. Click on jpg file.
  11. Error msg 'The requested content cannot be loaded.' appears (see actual behaviour above).

Server configuration

Operating system: Ubuntu 12.04

Web server: Server version: Apache/2.2.22 (Ubuntu), Server built: Mar 8 2013 15:53:13

Database: mysql

PHP version: PHP 5.3.10-1ubuntu3.6

ownCloud version: 5.0.7

Client configuration

Browser: Firefox 21.0

Operating system: Ubuntu 13.04

Logs

apache error.log

[Sun Jun 09 23:07:11 2013] [error] client 192.168.5.70The given path was above the root path: xsendfile: unable to find file: /mnt/external_storage/Test.txt, referer: https://mycloud/owncloud/index.php/apps/files?dir=/external_storage
[Sun Jun 09 23:07:11 2013] [error] [client 192.168.5.70] File does not exist: /var/www/core, referer: https://mycloud/owncloud/index.php/apps/files?dir=/external_storage
[Sun Jun 09 23:14:17 2013] [error] [client 127.0.0.1] client denied by server configuration: /var/www/owncloud/data/htaccesstest.txt
[Sun Jun 09 23:14:17 2013] [error] [client 127.0.0.1] File does not exist: /var/www/core
[Sun Jun 09 23:17:54 2013] [error] client 192.168.5.70The given path was above the root path: xsendfile: unable to find file: /mnt/external_storage/Test.txt, referer: https://mycloud/owncloud/index.php/apps/files?dir=//external_storage
[Sun Jun 09 23:17:54 2013] [error] [client 192.168.5.70] File does not exist: /var/www/core, referer: https://mycloud/owncloud/index.php/apps/files?dir=//external_storage
[Sun Jun 09 23:21:31 2013] [error] [client 127.0.0.1] client denied by server configuration: /var/www/owncloud/data/htaccesstest.txt
[Sun Jun 09 23:21:31 2013] [error] [client 127.0.0.1] File does not exist: /var/www/core

It seems that the external_storage should not be above root path. Shouldn't the external storage app care about this? How to fix it?

@MTGap
Copy link
Contributor

MTGap commented Jun 10, 2013

Is xsendfile not checking if the file is local?

@DeepDiver1975
Copy link
Member

Within the configuration of xsendfile you can/need to configure the local path which are allowed to be served:
http://doc.owncloud.org/server/5.0/admin_manual/configuration/xsendfile.html

We have no influence of the xsendfile configuration.

@XueSheng-GIT
Copy link
Author

Thanks for helping me out. This link was exactly the right hint. After adding the specified paths, everything is working as expected! It was not obvious to me that I had to do this change!

Wouldn't it be possible to let the external storage app do this change through the .htaccess file?
If not, wouldn't it make sense to provide some kind of hint during setup that this change must be done?

@DeepDiver1975
Copy link
Member

If not, wouldn't it make sense to provide some kind of hint during setup that this change must be done?

hehe - until you reported this issue nobody was thinking about this side effect.
We should put this to the documentation for xsendfile.

@XueSheng-GIT If you are interested you can enhance the documentation:

THX a lot

@jancborchardt
Copy link
Member

I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version (currently ownCloud 5.0.10) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

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

No branches or pull requests

4 participants