[Pkg-owncloud-commits] [owncloud] 88/457: Return 401 when accessing public webdav and s2s is disabled

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:05:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit f2a900e04ce80e259930341167a3c4575ea76275
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed May 20 12:19:03 2015 +0200

    Return 401 when accessing public webdav and s2s is disabled
---
 apps/files_sharing/publicwebdav.php | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php
index c2a16e9..b70274e 100644
--- a/apps/files_sharing/publicwebdav.php
+++ b/apps/files_sharing/publicwebdav.php
@@ -24,10 +24,6 @@
  *
  */
 
-if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false) {
-	return false;
-}
-
 // load needed apps
 $RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging');
 
@@ -56,6 +52,11 @@ $server->addPlugin(new \OC\Connector\Sabre\ExceptionLoggerPlugin('webdav', \OC::
 
 // wait with registering these until auth is handled and the filesystem is setup
 $server->on('beforeMethod', function () use ($server, $objectTree, $authBackend) {
+	if (OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled() === false) {
+		// this is what is thrown when trying to access a non-existing share
+		throw new \Sabre\DAV\Exception\NotAuthenticated();
+	}
+
 	$share = $authBackend->getShare();
 	$rootShare = \OCP\Share::resolveReShare($share);
 	$owner = $rootShare['uid_owner'];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list