I might be missing something, but this seems weird to me. If I upload a file via WebDav several times, the checksum field in the MariaDB is only set every 2nd upload. If I include the http “OC-Checksum:” header for the upload, the behaviour remains the same. After I refresh my localhost-browser-view, the db checksum is also set.
Steps to reproduce
- Upload a file via WebDav/cURL
curl -u admin:admin "http://localhost:8080/remote.php/dav/files/admin/test.txt" -T "test.txt"
- Check the MariaDB entry
+--------+----------------+------+------------+-----------+----------------------------------+-------------+-----------------------------------------------------------------------------------------------------+
| fileid | path | size | mtime | encrypted | etag | permissions | checksum |
+--------+----------------+------+------------+-----------+----------------------------------+-------------+-----------------------------------------------------------------------------------------------------+
| 4221 | files/test.txt | 295 | 1583843028 | 0 | bf64c4de8aab4837e728fa34de9431e4 | 27 | SHA1:edde2f3e9e741a77c04ad6681832333f20896ce0 MD5:e5e4d3b6b43b19ca028fbaaf144ae9b6 ADLER32:ad705297 |
+--------+----------------+------+------------+-----------+----------------------------------+-------------+-----------------------------------------------------------------------------------------------------+
MySQL commands
Login
mysql -u owncloud -p
owncloud
Select owncloud database
use owncloud;
Show checksum entry of “files/test.txt” from filecache table.
SELECT path, checksum FROM oc_filecache WHERE path="files/test.txt";
Or WebDav PROPFIND
Request:
curl -u admin:admin "http://localhost:8080/remote.php/dav/files/admin/test.txt" -X PROPFIND --data-binary @"find.txt"
with find.txt:
<?xml version="1.0" encoding="utf-8" ?>
<a:propfind xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns">
<a:prop>
<oc:checksums/>
</a:prop>
</a:propfind>
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>/remote.php/dav/files/admin/test.txt</d:href>
<d:propstat>
<d:prop>
<oc:checksums>
<oc:checksum>SHA1:edde2f3e9e741a77c04ad6681832333f20896ce0 MD5:e5e4d3b6b43b19ca028fbaaf144ae9b6 ADLER32:ad705297</oc:checksum>
</oc:checksums>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
- Repeat the upload
curl -u admin:admin "http://localhost:8080/remote.php/dav/files/admin/test.txt" -T "test.txt"
- Check the MariaDB entry again
+--------+----------------+------+------------+-----------+----------------------------------+-------------+----------+
| fileid | path | size | mtime | encrypted | etag | permissions | checksum |
+--------+----------------+------+------------+-----------+----------------------------------+-------------+----------+
| 4221 | files/test.txt | 295 | 1583843507 | 0 | ff1fb0f0602bf29040a9d76159d17b99 | 27 | |
+--------+----------------+------+------------+-----------+----------------------------------+-------------+----------+
WebDav PROPFIND 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>/remote.php/dav/files/admin/test.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>
Expected behaviour
The checksum field should be set.
Actual behaviour
The checksum field is not set.
Server configuration
Operating system: Linux Docker (on Windows 10 Pro 64bit)
Web server: Docker Image
Database: MariaDB
ownCloud version: Tested on 10.3.2 (stable) and 10.4.0 (stable)
Updated from an older ownCloud or fresh install: fresh install
Where did you install ownCloud from: Docker Image
Signing status (ownCloud 9.0 and above):
No errors have been found.
The content of config/config.php:
https://pastebin.com/bZTkHh5b
Are you using encryption: no
Are you using an external user-backend, if yes which one: Webdav