summaryrefslogtreecommitdiff
path: root/ucb/source/ucp
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2015-08-19 12:13:35 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:26:43 +0100
commit98c05dd05318e6c8a77801d85c015539d933ffa6 (patch)
treec6e9e0c52c091f3da6b08742ad97430b268f9022 /ucb/source/ucp
parentb5d91ff10fda72bc9758e7087f8a1a24d2d27022 (diff)
ucb: webdav-curl: tdf#83531 Opening WebDAV URL WebDav fails if write is restricted
Happened because LOCK method was not allowed without credentials. [ port of commit 0326352470aee1a774bb5aa314c4f3625c1372b3 ] Change-Id: Id94b96856737e50715c2a18427ba22c3776a8da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123272 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb/source/ucp')
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index f9933c639074..43884cdbab47 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -2997,6 +2997,28 @@ void Content::lock(
false );
}
break;
+ case DAVException::DAV_HTTP_AUTH:
+ {
+ SAL_WARN( "ucb.ucp.webdav", "lock: DAVException Authentication error - URL: <"
+ << m_xIdentifier->getContentIdentifier() << ">" );
+ // this could mean:
+ // - interaction handler for credential management not present (happens, depending
+ // on the LO framework processing)
+ // - the remote site is a WebDAV with special configuration: read/only for read operations
+ // and read/write for write operations, the user is not allowed to lock/write and
+ // she cancelled the credentials request.
+ // this is not actually an error, but the exception is sent directly from here, avoiding the automatic
+ // management that takes part in cancelCommandExecution() below
+ // Unfortunately there is no InteractiveNetwork*Exception available to signal this
+ // since it mostly happens on read/only part of webdav, this appears to be the most correct exception available
+ throw
+ ucb::InteractiveNetworkWriteException(
+ "Authentication error while trying to lock! Write only WebDAV perhaps?",
+ static_cast< cppu::OWeakObject * >( this ),
+ task::InteractionClassification_ERROR,
+ e.getData() );
+ }
+ break;
case DAVException::DAV_HTTP_ERROR:
//grab the error code
switch( e.getStatus() )