feature/taildrop, ipn/ipnlocal: remove leftover dup calls to osshare

I'd moved the osshare calls to feature/taildrop hooks, but forgot to
remove them from ipnlocal, or lost them during a rebase.

But then I noticed cmd/tailscaled also had some, so turn those into a
hook.

Updates #12614

Change-Id: I024fb1d27fbcc49c013158882ee5982c2737037d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-05-08 09:29:50 -07:00
committed by Brad Fitzpatrick
parent e2814871a7
commit 165b99278b
9 changed files with 40 additions and 32 deletions

View File

@@ -15,9 +15,9 @@ import (
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/mgr"
"tailscale.com/cmd/tailscaled/tailscaledhooks"
"tailscale.com/logtail/backoff"
"tailscale.com/types/logger"
"tailscale.com/util/osshare"
)
func init() {
@@ -81,8 +81,9 @@ func installSystemDaemonWindows(args []string) (err error) {
}
func uninstallSystemDaemonWindows(args []string) (ret error) {
// Remove file sharing from Windows shell (noop in non-windows)
osshare.SetFileSharingEnabled(false, logger.Discard)
for _, f := range tailscaledhooks.UninstallSystemDaemonWindows {
f()
}
m, err := mgr.Connect()
if err != nil {