Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use OC\AppFramework\Http\Request;
use OC\FilesMetadata\Model\FilesMetadata;
use OC\User\NoUserException;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
use OCA\Files_Sharing\External\Mount as SharingExternalMount;
use OCP\Accounts\IAccountManager;
Expand Down Expand Up @@ -374,7 +375,13 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
}

// Check if the user published their display name
$ownerAccount = $this->accountManager->getAccount($owner);
try {
$ownerAccount = $this->accountManager->getAccount($owner);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am checking the code executed by getAccount but I can't find a place that throws the NoUserException (yet).
What I see is that inside this function, there is a call to getUser with default arguments, one of which is $insertIfNotExists = true. Doesn't this mean that if the user is not local, it gets created? Is that ok?

} catch (NoUserException) {
// do not lock process if owner is not local
return null;
}

$ownerNameProperty = $ownerAccount->getProperty(IAccountManager::PROPERTY_DISPLAYNAME);

// Since we are not logged in, we need to have at least the published scope
Expand Down
Loading