From 56df8e1361247ba01a13183c40a3546d40ab3a51 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 9 Dec 2024 13:37:23 +0100 Subject: [PATCH 1/4] Update dependency. --- smb/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smb/pom.xml b/smb/pom.xml index 007be8f810a..b748d8ea9ad 100644 --- a/smb/pom.xml +++ b/smb/pom.xml @@ -23,7 +23,7 @@ smb jar - 0.13.0 + 0.14.0 1.20.4 From cf625eb18bfd2a9e09ee6d1e608e296425dd3d69 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 9 Dec 2024 13:45:11 +0100 Subject: [PATCH 2/4] Add option to set custom NTLM workstation name. --- defaults/src/main/resources/default.properties | 1 + smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java | 1 + 2 files changed, 2 insertions(+) diff --git a/defaults/src/main/resources/default.properties b/defaults/src/main/resources/default.properties index 46ebd4288c0..d4cffdfa6f1 100644 --- a/defaults/src/main/resources/default.properties +++ b/defaults/src/main/resources/default.properties @@ -544,6 +544,7 @@ nextcloud.root.webdav.user=remote.php/dav/{0}/{1} nextcloud.root.ocs=ocs/v1.php smb.domain.default=WORKGROUP +smb.ntlm.workstation= # Enable distributed filesystem path resolver smb.dfs.enable=true # Requires that messages from the server are signed diff --git a/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java b/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java index c44b902a757..16be67a8230 100644 --- a/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java +++ b/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java @@ -228,6 +228,7 @@ public SMBSession(final Host h) { protected Connection connect(final ProxyFinder proxy, final HostKeyCallback key, final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException { try { final SMBClient client = new SMBClient(SmbConfig.builder() + .withWorkStationName(new HostPreferences(host).getProperty("smb.ntlm.workstation")) .withSocketFactory(new ProxySocketFactory(host)) .withTimeout(ConnectionTimeoutFactory.get(new HostPreferences(host)).getTimeout(), TimeUnit.SECONDS) .withSoTimeout(new HostPreferences(host).getLong("smb.socket.timeout"), TimeUnit.SECONDS) From 5956bfc75c43054b5b6ec4a83ef17958017e9dc5 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 9 Dec 2024 13:57:53 +0100 Subject: [PATCH 3/4] Disable signing requests by default. Fix #16135. --- defaults/src/main/resources/default.properties | 2 ++ smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/src/main/resources/default.properties b/defaults/src/main/resources/default.properties index d4cffdfa6f1..d46892654c8 100644 --- a/defaults/src/main/resources/default.properties +++ b/defaults/src/main/resources/default.properties @@ -549,6 +549,8 @@ smb.ntlm.workstation= smb.dfs.enable=true # Requires that messages from the server are signed smb.signing.required=false +# Sign messages to the server +smb.signing.enable=false smb.encrypt.enable=false smb.socket.timeout=0 smb.protocol.negotiate.enable=true diff --git a/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java b/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java index 16be67a8230..b98299a0cc3 100644 --- a/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java +++ b/smb/src/main/java/ch/cyberduck/core/smb/SMBSession.java @@ -21,7 +21,6 @@ import ch.cyberduck.core.Host; import ch.cyberduck.core.HostKeyCallback; import ch.cyberduck.core.ListService; -import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.LoginCallback; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathContainerService; @@ -235,6 +234,7 @@ protected Connection connect(final ProxyFinder proxy, final HostKeyCallback key, .withAuthenticators(new NtlmAuthenticator.Factory()) .withDfsEnabled(new HostPreferences(host).getBoolean("smb.dfs.enable")) .withEncryptData(new HostPreferences(host).getBoolean("smb.encrypt.enable")) + .withSigningEnabled(new HostPreferences(host).getBoolean("smb.signing.enable")) .withSigningRequired(new HostPreferences(host).getBoolean("smb.signing.required")) .withRandomProvider(SecureRandomProviderFactory.get().provide()) .withMultiProtocolNegotiate(new HostPreferences(host).getBoolean("smb.protocol.negotiate.enable")) From 1f1231c6aa2d4880055c68cae49a80cea9d4b004 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Fri, 13 Dec 2024 12:08:20 +0100 Subject: [PATCH 4/4] Fix default required when supporting SMB 3.x dialect. --- defaults/src/main/resources/default.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/src/main/resources/default.properties b/defaults/src/main/resources/default.properties index d46892654c8..a6d91f7305e 100644 --- a/defaults/src/main/resources/default.properties +++ b/defaults/src/main/resources/default.properties @@ -550,7 +550,7 @@ smb.dfs.enable=true # Requires that messages from the server are signed smb.signing.required=false # Sign messages to the server -smb.signing.enable=false +smb.signing.enable=true smb.encrypt.enable=false smb.socket.timeout=0 smb.protocol.negotiate.enable=true