taildrop: lazily perform full deletion scan after first taildrop use (#10137)
Simply reading the taildrop directory can pop up security dialogs on platforms like macOS. Avoid this by only performing garbage collection of partial and deleted files after the first received taildrop file, which would have prompted the security dialog window. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
@@ -3728,6 +3728,7 @@ func (b *LocalBackend) initPeerAPIListener() {
|
||||
taildrop: taildrop.ManagerOptions{
|
||||
Logf: b.logf,
|
||||
Clock: tstime.DefaultClock{Clock: b.clock},
|
||||
State: b.store,
|
||||
Dir: fileRoot,
|
||||
DirectFileMode: b.directFileRoot != "",
|
||||
AvoidFinalRename: !b.directFileDoFinalRename,
|
||||
|
||||
@@ -53,6 +53,11 @@ const (
|
||||
// CurrentProfileStateKey is the key under which we store the current
|
||||
// profile.
|
||||
CurrentProfileStateKey = StateKey("_current-profile")
|
||||
|
||||
// TaildropReceivedKey is the key to indicate whether any taildrop file
|
||||
// has ever been received (even if partially).
|
||||
// Any non-empty value indicates that at least one file has been received.
|
||||
TaildropReceivedKey = StateKey("_taildrop-received")
|
||||
)
|
||||
|
||||
// CurrentProfileID returns the StateKey that stores the
|
||||
|
||||
Reference in New Issue
Block a user