[stable6][WIP]Flock stable6

:construction: 

requires https://github.com/owncloud/core/pull/8778 to be backported as well