ipn/ipnlocal: add file sharing to windows shell

Updates: tailscale/winmin#33

Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
This commit is contained in:
Aleksandar Pesic
2021-04-22 09:25:00 +02:00
committed by Brad Fitzpatrick
parent e41075dd4a
commit 7c985e4944
7 changed files with 160 additions and 33 deletions

View File

@@ -16,6 +16,7 @@ import (
"golang.org/x/sys/windows/svc/mgr"
"tailscale.com/logtail/backoff"
"tailscale.com/types/logger"
"tailscale.com/util/osshare"
)
func init() {
@@ -79,6 +80,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)
m, err := mgr.Connect()
if err != nil {
return fmt.Errorf("failed to connect to Windows service manager: %v", err)