aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Harrison <keithh@protonmail.com>2023-08-02 07:14:53 +0000
committerGitHub <noreply@github.com>2023-08-02 07:14:53 +0000
commiteed12f3ec51b0e261e5a58033f35161e6d72b496 (patch)
treec1c27310daa974ec64e555cdca5d86b31d47140d
parent53239281593cba4192d592ac694958876a184d84 (diff)
downloadsyncthing-eed12f3ec51b0e261e5a58033f35161e6d72b496.tar.gz
syncthing-eed12f3ec51b0e261e5a58033f35161e6d72b496.zip
lib/config: Allow sharing already encrypted folder with untrusted devices (fixes #8965) (#9012)
Safety check added in v1.23.6 introduced bug. Bug unshares folders with untrusted devices if folder does not have an encryption password set, regardless of whether the folder is shared with the untrusted device as encrypted or not. Prevents sharing with untrusted devices in some cases where sharing would be encrypted. Patch preserves safety check but permits sharing folders with untrusted devices if they are shared as encrypted. Signed-off-by: kewiha <keithh@protonmail.com>
-rw-r--r--lib/config/config.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/config/config.go b/lib/config/config.go
index 0534d5f91..8787cf8b5 100644
--- a/lib/config/config.go
+++ b/lib/config/config.go
@@ -556,8 +556,8 @@ loop:
func ensureNoUntrustedTrustingSharing(f *FolderConfiguration, devices []FolderDeviceConfiguration, existingDevices map[protocol.DeviceID]*DeviceConfiguration) []FolderDeviceConfiguration {
for i := 0; i < len(devices); i++ {
dev := devices[i]
- if dev.EncryptionPassword != "" {
- // There's a password set, no check required
+ if dev.EncryptionPassword != "" || f.Type == FolderTypeReceiveEncrypted {
+ // There's a password set or the folder is received encrypted, no check required
continue
}
if devCfg := existingDevices[dev.DeviceID]; devCfg.Untrusted {