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
files_external SMB: throw InvalidArgument when user is not set
Signed-off-by: Anderson Luiz Alves <[email protected]>
  • Loading branch information
alacn1 authored and backportbot[bot] committed Jan 14, 2022
commit 1bc2905a4df83ac7d7084274c42623b8b7c1fd40
4 changes: 4 additions & 0 deletions apps/files_external/lib/Lib/Backend/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public function __construct(IL10N $l, Password $legacyAuth) {
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
$auth = $storage->getAuthMechanism();
if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) {
if (!is_string($storage->getBackendOption('user')) || !is_string($storage->getBackendOption('password'))) {
throw new \InvalidArgumentException('user or password is not set');
}

$smbAuth = new BasicAuth(
$storage->getBackendOption('user'),
$storage->getBackendOption('domain'),
Expand Down