core
core copied to clipboard
[QA] a duplicated federated share request causes strange misparsing of the share name
Seen with ownCloud core 10.13.0-rc.1 (not a regression)
dname=$(docker run --rm -ti -p 6660:8080 owncloud/server:10.13.0-rc.1 -d)
url="http://localhost:6660/ocs/v1.php/cloud/shares?format=json"
data='{"shareWith": "admin", "token": "12345678901234567890", "name": "JustAFile.txt", "remoteId": "666", "owner": "admin", "ownerFederatedId": "admin@http://localhost:6660", "sharedBy": "admin", "sharedByFederatedId": "admin", "remote": "http://localhost:6660/"}'
curl -H "Content-Type: application/json" --data "$data" $url
{"ocs":{"meta":{"status":"ok","statuscode":100,"message":null,"totalitems":"","itemsperpage":""},"data":[]}}
docker exec -ti $dname sqlite3 /mnt/data/files/owncloud.db 'select * from oc_share_external'
1|http://localhost:6660|12345678901234567890||admin|admin|{{TemporaryMountPointName#/JustAFile.txt}}|ade6f683e04ed168c8482f849b5a228b|0|666||/JustAFile.txt
# send exactly the same request again:
curl -H "Content-Type: application/json" --data "$data" $url
{"ocs":{"meta":{"status":"ok","statuscode":100,"message":null,"totalitems":"","itemsperpage":""},"data":[]}}
docker exec -ti $dname sqlite3 /mnt/data/files/owncloud.db 'select * from oc_share_external'
1|http://localhost:6660|12345678901234567890||admin|admin|{{TemporaryMountPointName#/JustAFile.txt}}|ade6f683e04ed168c8482f849b5a228b|0|666||/JustAFile.txt
2|http://localhost:6660|12345678901234567890||admin|admin|{{TemporaryMountPointName#/JustAFile.txt}}-1|4a2d9c22ee2066ba303684b72a9e901d|0|666||/JustAFile.txt
The mountpoint gets disambiguated by appending -1
On the webUI the result now looks like this:
Expected behaviour:
- The
}}should not be embedded in the name. - The user should seen
JustAFile.txt-1in this case.
I assume, the mounpoint syntax in oc_share_external needs to have the -1 suffix inside the curly braces, not outside?
The duplicate causes an error, when trying to accept:
The log says:
{"reqId":"Yo3JDGhwYUfXVNynyLtE","level":3,"time":"2023-08-17T13:47:08+00:00","remoteAddr":"172.17.0.1","user":"admin","app":"PHP","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"Uninitialized string offset: 0 at \/var\/www\/owncloud\/lib\/private\/URLGenerator.php#242"}
{"reqId":"Yo3JDGhwYUfXVNynyLtE","level":3,"time":"2023-08-17T13:47:08+00:00","remoteAddr":"172.17.0.1","user":"admin","app":"PHP","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"Uninitialized string offset: 0 at \/var\/www\/owncloud\/lib\/private\/URLGenerator.php#242"}
{"reqId":"CycuF9U6CuqwdGknb7Kl","level":3,"time":"2023-08-17T13:47:25+00:00","remoteAddr":"172.17.0.1","user":"admin","app":"PHP","method":"POST","url":"\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/remote_shares\/pending\/4?format=json","message":"Undefined index: password at \/var\/www\/owncloud\/apps\/files_sharing\/lib\/External\/Storage.php#92"}
{"reqId":"JFoAHYdd9hVXizE9Nnxq","level":3,"time":"2023-08-17T13:47:38+00:00","remoteAddr":"172.17.0.1","user":"admin","app":"PHP","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"Uninitialized string offset: 0 at \/var\/www\/owncloud\/lib\/private\/URLGenerator.php#242"}
{"reqId":"JFoAHYdd9hVXizE9Nnxq","level":3,"time":"2023-08-17T13:47:38+00:00","remoteAddr":"172.17.0.1","user":"admin","app":"PHP","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"Uninitialized string offset: 0 at \/var\/www\/owncloud\/lib\/private\/URLGenerator.php#242"}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed.