aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-02-09 08:48:07 +0100
committerJulius Härtl <jus@bitgrid.net>2023-02-09 10:19:37 +0100
commit7b413a41eb1e937783032e98fd918a1e1ac8ce6d (patch)
tree755d5a2cf80b81456a2d9941e595a8d2e6e5ee93 /apps/dav
parentc10317f7f9f53a4de464915f754896eed7f1ee6c (diff)
downloadnextcloud-server-7b413a41eb1e937783032e98fd918a1e1ac8ce6d.tar.gz
nextcloud-server-7b413a41eb1e937783032e98fd918a1e1ac8ce6d.zip
perf(dav): Do not call general setupFS on ever dav auth
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Connector/Sabre/Auth.php3
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/AuthTest.php12
2 files changed, 6 insertions, 9 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php
index 1610c554b9b..69821c63c21 100644
--- a/apps/dav/lib/Connector/Sabre/Auth.php
+++ b/apps/dav/lib/Connector/Sabre/Auth.php
@@ -104,14 +104,11 @@ class Auth extends AbstractBasic {
if ($this->userSession->isLoggedIn() &&
$this->isDavAuthenticated($this->userSession->getUser()->getUID())
) {
- \OC_Util::setupFS($this->userSession->getUser()->getUID());
$this->session->close();
return true;
} else {
- \OC_Util::setupFS(); //login hooks may need early access to the filesystem
try {
if ($this->userSession->logClientIn($username, $password, $this->request, $this->throttler)) {
- \OC_Util::setupFS($this->userSession->getUser()->getUID());
$this->session->set(self::DAV_AUTHENTICATED, $this->userSession->getUser()->getUID());
$this->session->close();
return true;
diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php
index 72800b84253..be841295f0b 100644
--- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php
@@ -117,7 +117,7 @@ class AuthTest extends TestCase {
$user = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
- $user->expects($this->exactly(2))
+ $user->expects($this->exactly(1))
->method('getUID')
->willReturn('MyTestUser');
$this->userSession
@@ -125,7 +125,7 @@ class AuthTest extends TestCase {
->method('isLoggedIn')
->willReturn(true);
$this->userSession
- ->expects($this->exactly(2))
+ ->expects($this->exactly(1))
->method('getUser')
->willReturn($user);
$this->session
@@ -171,7 +171,7 @@ class AuthTest extends TestCase {
$user = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
- $user->expects($this->exactly(3))
+ $user->expects($this->exactly(2))
->method('getUID')
->willReturn('MyTestUser');
$this->userSession
@@ -179,7 +179,7 @@ class AuthTest extends TestCase {
->method('isLoggedIn')
->willReturn(true);
$this->userSession
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUser')
->willReturn($user);
$this->session
@@ -660,11 +660,11 @@ class AuthTest extends TestCase {
$user = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
- $user->expects($this->exactly(3))
+ $user->expects($this->exactly(2))
->method('getUID')
->willReturn('MyTestUser');
$this->userSession
- ->expects($this->exactly(4))
+ ->expects($this->exactly(3))
->method('getUser')
->willReturn($user);
$response = $this->auth->check($server->httpRequest, $server->httpResponse);