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

Updating a non-exist file which name contains '%00' causes internal server error #1424

Closed
ghost opened this issue Sep 16, 2016 · 1 comment
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@ghost
Copy link

ghost commented Sep 16, 2016

Steps to reproduce

1.Try to update file content by passing an non-exist file which name contains '%00'

curl -i -X PUT -H 'OCS-APIREQUEST: true' \
-H 'Cookie: xx' -H 'requesttoken: xx' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
http://localhost/nextcloud/index.php/apps/files_texteditor/ajax/savefile \
-d 'filecontents=aa&path=%2FDocuments/File%00.txt&mtime=1473993851'

2.Check the response body

{"message":"An internal server error occurred."}

3.Check nextcloud.log, there is an error message

{
    "reqId": "xx",
    "remoteAddr": "xx",
    "app": "PHP",
    "message": "realpath() expects parameter 1 to be a valid path, string given at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#360",
    "level": 3,
    "time": "2016-09-16T03:55:24+00:00",
    "method": "PUT",
    "url": "/nextcloud/index.php/apps/files_texteditor/ajax/savefile",
    "user": "admin"
}

Expected behaviour

Handle this error and return more readable error message.

Actual behaviour

Looks like this is not a functional issue.

Server configuration

Operating system:
CentOS 7 x86_64
Linux 10.211.55.9 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Web server:
httpd-2.4.6-40.el7.centos.4.x86_64

Database:
sqlite3

PHP version:
PHP 5.4.16 (cli) (built: Aug 11 2016 21:24:59)

Nextcloud version: (see Nextcloud admin page)
Nextcloud 10.0 (stable)

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

List of activated apps:

The content of config/config.php:

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Client configuration

Browser:
Firefox ESR 38.3.0

Operating system:
CentOS 7 x86_64

Logs

Web server error log

Nextcloud log (data/nextcloud.log)

Browser log

@MorrisJobke MorrisJobke added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 16, 2016
@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@MorrisJobke
Copy link
Member

This is an issue within the files_texteditor app. Thus please report it to the maintainer of that app in its repository: https://github.com/nextcloud/files_texteditor

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

2 participants