Skip to content

share receiver can rename a file in a locked folder by using the lock token of the owner #34338

Open
@individual-it

Description

@individual-it

Steps to reproduce

  1. create a folder with a file
  2. share the folder to an other user
  3. as owner lock the folder
  4. as receiver find the locktoken by PROPFIND
  5. as receiver rename the file by a MOVE request and giving the locktoken of the owner curl -u uu2:uu2 -X MOVE "http://localhost/owncloud-core/remote.php/dav/files/uu2/folder/file.txt" -H "Destination: http://localhost/owncloud-core/remote.php/dav/files/uu2/folder/renamed.txt" -H "If: (<opaquelocktoken:8eccec3d-9c12-49e0-8ad0-54c6a5169c9d>)" -v

Expected behaviour

HTTP response 423
File is not renamed

Actual behaviour

HTTP response 403
File is renamed

After sabre/dav 4.20:
HTTP response 201
File is renamed
(the behavior at least becomes consistent, even if it is wrong!)

Logs

Web server error log

ownCloud log (data/owncloud.log)

{"reqId":"jOOLALr1P5HctlMUkOnb","level":0,"time":"2019-01-31T08:06:19+00:00","remoteAddr":"127.0.0.1","user":"uu2","app":"webdav","method":"MOVE","url":"\/owncloud-core\/remote.php\/dav\/files\/uu2\/folder\/file.txt","message":"Exception: HTTP\/1.1 403 Forbidden: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\Forbidden\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(96): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\LockPlugin->beforeUnlock('files\\\/uu2\\\/folde...', Object(OC\\\\Lock\\\\Persistent\\\\Lock))\\n#1 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Locks\\\/Plugin.php(347): Sabre\\\\DAV\\\\Server->emit('beforeUnlock', Array)\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Locks\\\/Plugin.php(311): Sabre\\\\DAV\\\\Locks\\\\Plugin->unlockNode('files\\\/uu2\\\/folde...', Object(Sabre\\\\DAV\\\\Locks\\\\LockInfo))\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(96): Sabre\\\\DAV\\\\Locks\\\\Plugin->afterUnbind(*** sensitive parameters replaced ***)\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(648): Sabre\\\\DAV\\\\Server->emit('afterUnbind', Array)\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(96): Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(464): Sabre\\\\DAV\\\\Server->emit('method:MOVE', Array)\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(241): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(309): Sabre\\\\DAV\\\\Server->start()\\n#9 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(299): Sabre\\\\DAV\\\\Server->exec()\\n#10 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#11 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(175): require_once('\\\/home\\\/artur\\\/www...')\\n#12 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/LockPlugin.php\",\"Line\":110}"}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions