Kaydet (Commit) 297be63c authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Thorsten Behrens

Option to turn off WebDAV file locking

Locking files on WebDAV shares was implemented in tdf#82744,
in particular:

commit 26e6d4b0
    tdf#82744: fix WebDAV lock/unlock behaviour - part 1
commit bc9a8ddb
    tdf#82744: fix WebDAV lock/unlock behaviour - part 2
commit b4576f3d
    tdf#82744: fix WebDAV lock/unlock behaviour - part 3
commit fed29842
    tdf#82744: fix WebDAV lock/unlock behaviour - part 4

Before that, files on WebDAV shares were accessed w/o locking since
the beginning of [OOo] time. This option allows to revert to
the old behaviour i.e. non-locking WebDAV access.

For concurrent read-write WebDAV access by multiple users it is
recommended to keep UseWebDAVFileLocking at default value (true)

Change-Id: Id92177631d4854d6c7bf412164acbd9740db9592
Reviewed-on: https://gerrit.libreoffice.org/64116
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 71636d56
......@@ -5356,6 +5356,15 @@
</info>
<value>true</value>
</prop>
<prop oor:name="UseWebDAVFileLocking" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Determines if WebDAV-specific file locking is used for documents
on WebDAV shares. It is not recommended to set this option to 'false' in
scenarios where multi-user, concurrent read/write access to WebDAV share
is required</desc>
</info>
<value>true</value>
</prop>
<prop oor:name="UseDocumentOOoLockFile" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Allows to specify whether the OOo document file locking
......
......@@ -173,6 +173,11 @@ bool IsLockingUsed()
#endif
bool IsWebDAVLockingUsed()
{
return officecfg::Office::Common::Misc::UseWebDAVFileLocking::get();
}
/// Gets default attributes of a file:// URL.
sal_uInt64 GetDefaultFileAttributes(const OUString& rURL)
{
......@@ -1088,6 +1093,10 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
if ( GetURLObject().isAnyKnownWebDAVScheme() )
{
// do nothing if WebDAV locking is disabled
if (!IsWebDAVLockingUsed())
return LockFileResult::Succeeded;
try
{
bool bResult = pImpl->m_bLocked;
......@@ -2866,6 +2875,12 @@ void SfxMedium::UnlockFile( bool bReleaseLockStream )
// check if webdav
if ( GetURLObject().isAnyKnownWebDAVScheme() )
{
// do nothing if WebDAV locking if disabled
// (shouldn't happen because we already skipped locking,
// see LockOrigFileOnDemand, but just in case ...)
if (!IsWebDAVLockingUsed())
return;
if ( pImpl->m_bLocked )
{
// an interaction handler should be used for authentication, if needed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment