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:
Joe Tsai
2023-11-13 10:20:28 -08:00
committed by GitHub
parent e848736927
commit 975c5f7684
6 changed files with 54 additions and 7 deletions

View File

@@ -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,