mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-04 20:09:03 +00:00
ipn,tailfs: tie TailFS share configuration to user profile
Previously, the configuration of which folders to share persisted across profile changes. Now, it is tied to the user's profile. Updates tailscale/corp#16827 Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
committed by
Percy Wegmann
parent
16ae0f65c0
commit
6c160e6321
@@ -10,6 +10,7 @@ import (
|
||||
"net/netip"
|
||||
|
||||
"tailscale.com/tailcfg"
|
||||
"tailscale.com/tailfs"
|
||||
"tailscale.com/types/persist"
|
||||
"tailscale.com/types/preftype"
|
||||
)
|
||||
@@ -24,6 +25,12 @@ func (src *Prefs) Clone() *Prefs {
|
||||
*dst = *src
|
||||
dst.AdvertiseTags = append(src.AdvertiseTags[:0:0], src.AdvertiseTags...)
|
||||
dst.AdvertiseRoutes = append(src.AdvertiseRoutes[:0:0], src.AdvertiseRoutes...)
|
||||
if src.TailFSShares != nil {
|
||||
dst.TailFSShares = make([]*tailfs.Share, len(src.TailFSShares))
|
||||
for i := range dst.TailFSShares {
|
||||
dst.TailFSShares[i] = src.TailFSShares[i].Clone()
|
||||
}
|
||||
}
|
||||
dst.Persist = src.Persist.Clone()
|
||||
return dst
|
||||
}
|
||||
@@ -56,6 +63,7 @@ var _PrefsCloneNeedsRegeneration = Prefs(struct {
|
||||
AppConnector AppConnectorPrefs
|
||||
PostureChecking bool
|
||||
NetfilterKind string
|
||||
TailFSShares []*tailfs.Share
|
||||
Persist *persist.Persist
|
||||
}{})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user