From eed12f3ec51b0e261e5a58033f35161e6d72b496 Mon Sep 17 00:00:00 2001 From: Keith Harrison Date: Wed, 2 Aug 2023 07:14:53 +0000 Subject: [PATCH] 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 --- lib/config/config.go | 4 ++-- 1 file 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 {