aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2025-07-10 15:08:22 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2025-07-10 23:21:16 +0200
commitfd799afc176f0c8d38c0b4fb8e2915dcdaa4ca57 (patch)
treec1dac6159e4aee4103c24239416308aee9d8af31
parentc0b31d1e2d2d373205181904b38f88e47d4ee8ab (diff)
downloadnextcloud-server-fd799afc176f0c8d38c0b4fb8e2915dcdaa4ca57.tar.gz
nextcloud-server-fd799afc176f0c8d38c0b4fb8e2915dcdaa4ca57.zip
fix(Krb): switch away from deprecated and broken KerberosApacheAuth()
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/files_external/lib/Lib/Backend/SMB.php7
-rw-r--r--build/psalm-baseline.xml5
2 files changed, 4 insertions, 8 deletions
diff --git a/apps/files_external/lib/Lib/Backend/SMB.php b/apps/files_external/lib/Lib/Backend/SMB.php
index 4479ecdcaaa..ef55190710c 100644
--- a/apps/files_external/lib/Lib/Backend/SMB.php
+++ b/apps/files_external/lib/Lib/Backend/SMB.php
@@ -9,8 +9,8 @@
namespace OCA\Files_External\Lib\Backend;
use Icewind\SMB\BasicAuth;
-use Icewind\SMB\KerberosApacheAuth;
use Icewind\SMB\KerberosAuth;
+use Icewind\SMB\KerberosTicket;
use Icewind\SMB\Native\NativeServer;
use Icewind\SMB\Wrapped\Server;
use OCA\Files_External\Lib\Auth\AuthMechanism;
@@ -85,9 +85,10 @@ class SMB extends Backend {
throw new \InvalidArgumentException('invalid authentication backend');
}
$credentialsStore = $auth->getCredentialsStore();
- $kerbAuth = new KerberosApacheAuth();
+ $kerbAuth = new KerberosAuth();
+ $kerbAuth->setTicket(KerberosTicket::fromEnv());
// check if a kerberos ticket is available, else fallback to session credentials
- if ($kerbAuth->checkTicket()) {
+ if ($kerbAuth->getTicket()?->isValid()) {
$smbAuth = $kerbAuth;
} else {
try {
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index 21007bec0bf..234fed2637c 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -1462,11 +1462,6 @@
<code><![CDATA[class-string<IStorage>]]></code>
</MoreSpecificReturnType>
</file>
- <file src="apps/files_external/lib/Lib/Backend/SMB.php">
- <DeprecatedClass>
- <code><![CDATA[new KerberosApacheAuth()]]></code>
- </DeprecatedClass>
- </file>
<file src="apps/files_external/lib/Lib/Storage/SFTP.php">
<InternalMethod>
<code><![CDATA[put]]></code>