You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/util
Aaron Klotz db39a43f06 util/winutil: add support for restarting Windows processes in specific sessions
This PR is all about adding functionality that will enable the installer's
upgrade sequence to terminate processes belonging to the previous version,
and then subsequently restart instances belonging to the new version within
the session(s) corresponding to the processes that were killed.

There are multiple parts to this:

* We add support for the Restart Manager APIs, which allow us to query the
  OS for a list of processes locking specific files;
* We add the RestartableProcess and RestartableProcesses types that query
  additional information about the running processes that will allow us
  to correctly restart them in the future. These types also provide the
  ability to terminate the processes.
* We add the StartProcessInSession family of APIs that permit us to create
  new processes within specific sessions. This is needed in order to
  properly attach a new GUI process to the same RDP session and desktop that
  its previously-terminated counterpart would have been running in.
* I tweaked the winutil token APIs again.
* A lot of this stuff is pretty hard to test without a very elaborate
  harness, but I added a unit test for the most complicated part (though it
  requires LocalSystem to run).

Updates https://github.com/tailscale/corp/issues/13998

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
6 months ago
..
cibuild all: update copyright and license headers 1 year ago
clientmetric util/clientmetric: allow client metric values to be provided by a function 1 year ago
cloudenv all: update copyright and license headers 1 year ago
cmpver util/cmpver: only consider ascii numerals (#9741) 8 months ago
cmpx all: update exp/slices and fix call sites 10 months ago
codegen util/codegen: support embedded fields 1 year ago
cstruct all: update copyright and license headers 1 year ago
deephash util/deephash: add IncludeFields, ExcludeFields HasherForType Options 9 months ago
dirwalk all: use tstest.Replace more 1 year ago
dnsname cmd/tailscale: extend hostname validation (#7678) 1 year ago
goroutines util/goroutines: let ScrubbedGoroutineDump get only current stack 11 months ago
groupmember util/groupmember: fail earlier if group doesn't exist, use slices.Contains 7 months ago
hashx all: update copyright and license headers 1 year ago
httphdr util/httphdr: add new package for parsing HTTP headers (#9797) 8 months ago
httpm util/httpm: don't run test if .git doesn't exist 6 months ago
jsonutil all: update copyright and license headers 1 year ago
limiter util/lru, util/limiter: add debug helper to dump state as HTML 9 months ago
lineread all: update copyright and license headers 1 year ago
linuxfw util/linuxfw: add missing error checks in tests 7 months ago
lru util/lru: update c.head when deleting the most recently used entry 9 months ago
mak various: add golangci-lint, fix issues (#7905) 1 year ago
multierr all: use Go 1.21 slices, maps instead of x/exp/{slices,maps} 10 months ago
must all: update copyright and license headers 1 year ago
nocasemaps util/nocasemaps: import nocasemaps from corp 8 months ago
osdiag util/osdiag, util/winutil: expose Windows policy key 7 months ago
osshare all: update copyright and license headers 1 year ago
osuser ssh/tailssh,util: extract new osuser package from ssh code (#10170) 7 months ago
pidowner all: update copyright and license headers 1 year ago
precompress all: update copyright and license headers 1 year ago
quarantine all: update copyright and license headers 1 year ago
race util/race: add test to confirm we don't leak goroutines 8 months ago
racebuild all: update copyright and license headers 1 year ago
rands util/rands: add package with HexString func 9 months ago
ringbuffer util/ringbuffer: move generic ringbuffer from corp repo 1 year ago
set util/set: implement json.Marshaler/Unmarshaler (#10308) 6 months ago
singleflight all: update copyright and license headers 1 year ago
slicesx util/slicesx: add EqualSameNil, like slices.Equal but same nilness 8 months ago
syspolicy syspolicy: add exit node related policies (#10172) 6 months ago
sysresources util/sysresources, magicsock: scale DERP buffer based on system memory 1 year ago
systemd all: update copyright and license headers 1 year ago
testenv util/testenv: add new package to hold InTest 10 months ago
truncate util: add truncate package (#7490) 1 year ago
uniq all: update copyright and license headers 1 year ago
vizerror util/vizerror: add As function to get wrapped Error 1 year ago
winutil util/winutil: add support for restarting Windows processes in specific sessions 6 months ago