owncloud / owncloud/core

A overwritten file with inside "share_folder" doesnt returns checksum

Open
#38,835 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:Bug
Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

Description

Steps to reproduce
  1. Set "shares_folder" to Shares
occ config:system:set --value 'Shares' --type string share_folder
  1. as admin create file lorem.txt and share with another user test123
  2. as test123 overwrite the received share with checksum
curl -XPUT http://localhost/core/remote.php/dav/files/test123/Shares/lorem.txt -d 'hello world new' -H 'OC-Checksum: SHA1:17b6b669b2361937cc739e2203243447cfd4678b'  -u test123:test123 -v
  1. as test123 try to get the checksum of the updated file
curl -XPROPFIND http://localhost/core/remote.php/dav/files/test123/Shares/lorem.txt -d '<?xml version="1.0"?><d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:prop><oc:checksums /></d:prop></d:propfind>' -u test123:test123 -kv | xmllint --format -
Expected behaviour

The valid checksum should be returned

Actual behaviour

Checksum property is returned empty in webdav response

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/core/remote.php/dav/files/test123/Shares/lorem.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:checksums/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus> 
Server configuration

Operating system: ubuntu 20.04

Web server: apache 2

Database: mysql Ver 8.0.25-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

PHP version: 7.4

ownCloud version: (see ownCloud admin page) git master

Updated from an older ownCloud or fresh install:

Where did you install ownCloud from: git

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the overwrite and PROPFIND requests shown in the issue against the WebDAV endpoint, then trace how checksum properties are handled for files in the configured Shares folder. Done means the PROPFIND response returns the valid checksum instead of an empty property with HTTP 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.