summaryrefslogtreecommitdiffhomepage
path: root/atomicfile
AgeCommit message (Collapse)AuthorFilesLines
2025-06-26ipn/store: automatically migrate between plaintext and encrypted state (#16318)Andrew Lytvynov1-1/+5
Add a new `--encrypt-state` flag to `cmd/tailscaled`. Based on that flag, migrate the existing state file to/from encrypted format if needed. Updates #15830 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-01-15atomicfile: use ReplaceFile on Windows so that attributes and ACLs are preservedAaron Klotz6-3/+257
I moved the actual rename into separate, GOOS-specific files. On non-Windows, we do a simple os.Rename. On Windows, we first try ReplaceFile with a fallback to os.Rename if the target file does not exist. ReplaceFile is the recommended way to rename the file in this use case, as it preserves attributes and ACLs set on the target file. Updates #14428 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2023-04-17various: add golangci-lint, fix issues (#7905)Andrew Dunham1-1/+1
This adds an initial and intentionally minimal configuration for golang-ci, fixes the issues reported, and adds a GitHub Action to check new pull requests against this linter configuration. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I8f38fbc315836a19a094d0d3e986758b9313f163
2023-04-04atomicfile: use /tmp for socket path on macOSJames Tucker1-4/+13
macOS does not allow unix socket creation in private temp directories, but global /tmp is ok, so swap out for global temp for now. Updates #7658 Updates #7785 Signed-off-by: James Tucker <jftucker@gmail.com>
2023-03-31atomicfile: reject overwriting irregular filesJames Tucker2-2/+46
The intent of atomicfile is to overwrite regular files. Most use cases that would overwrite irregular files, unix sockets, named pipes, devices, and so on are more than likely misuse, so disallow them. Fixes #7658 Signed-off-by: James Tucker <james@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-09-15refactor: move from io/ioutil to io and os packagesEng Zer Jun1-2/+1
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Reference: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-13atomicfile: update docs to clarify behavior of argumentMaisem Ali1-1/+1
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2020-07-15atomicfile: don't Chmod on windowsBrad Fitzpatrick1-2/+5
Not supported.
2020-07-14atomicfile: use ioutil.TempFile, syncBrad Fitzpatrick1-8/+24
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-03-17scripts: add a license header checker.David Anderson1-1/+1
Signed-off-by: David Anderson <dave@natulte.net>
2020-02-09Move Linux client & common packages into a public repo.Earl Lee1-0/+28