mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-13 06:07:34 +00:00
ipn, paths: unconditionally attempt to set state dir perms, but only if the state dir is ours
We unconditionally set appropriate perms on the statefile dir. We look at the basename of the statefile dir, and if it is "tailscale", then we set perms as appropriate. Fixes #2925 Updates #2856 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
This commit is contained in:
@@ -63,9 +63,9 @@ func xdgDataHome() string {
|
||||
}
|
||||
|
||||
func ensureStateDirPerms(dirPath string) error {
|
||||
// Unfortunately there are currently numerous tests that set up state files
|
||||
// right off of /tmp, on which Chmod will of course fail. We should fix our
|
||||
// test harnesses to not do that, at which point we can return an error.
|
||||
os.Chmod(dirPath, 0700)
|
||||
return nil
|
||||
if filepath.Base(dirPath) != "tailscale" {
|
||||
return nil
|
||||
}
|
||||
|
||||
return os.Chmod(dirPath, 0700)
|
||||
}
|
||||
|
Reference in New Issue
Block a user