Repository navigation
lib/model: Fix passwords on receive-enc needing token (ref #7518) - #7739
Merged
Merged
Conversation
calmh
approved these changes
Jun 3, 2021
| for _, id := range closeDevices { | ||
| delete(clusterConfigDevices, id) | ||
| if conn, ok := m.conn[id]; ok { | ||
| go conn.Close(errDevicePaused) |
Member
There was a problem hiding this comment.
We might be sending multiple closes here for the same connection; I'm going to assume that's OK.
Member
Author
There was a problem hiding this comment.
Yes, that's a noop then (there's a sync.Once in protocol.Connection).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was testing some encryption related UI changes (not this PR) when suddenly all hell broke loose: The trusted side treated received encrypted file indexes like normal files. Reason is that the change in #7198 is just plain broken, luckily it only matters if you have encrypted folders both ways (folder1: A untrusted <-> B, folder2: A <-> B untrusted). That is uncommon enough that no-one seems to have run into it yet - yeii for not cleaning up old test folders on test setups.
The completely broken part is returning early from
generateClusterConfigwithpasswords == nil, and then ignoring that error inAddConnection, thus going ahead and callingConnection.SetPasswordswith a nil map.I basically reverted #7518 and to keep #7198 fixed, I added a new check to
CommitConfiguration: If a receive-encrypted folder changes, and it doesn't have the token yet, don't just resend a cluster config, but drop the connection (to get the token).