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/winutil
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>
7 months ago
..
authenticode util/winutil/authenticode: add missing docs for CertSubjectError 11 months ago
policy winutil: refactor methods to get values from registry to also return (#9536) 9 months ago
testdata/testrestartableprocesses util/winutil: add support for restarting Windows processes in specific sessions 7 months ago
mksyscall.go util/winutil: add support for restarting Windows processes in specific sessions 7 months ago
restartmgr_windows.go util/winutil: add support for restarting Windows processes in specific sessions 7 months ago
restartmgr_windows_test.go util/winutil: add support for restarting Windows processes in specific sessions 7 months ago
subprocess_windows_test.go util/winutil: add support for restarting Windows processes in specific sessions 7 months ago
svcdiag_windows.go all: use set.Set consistently instead of map[T]struct{} 10 months ago
winutil.go util/osdiag, util/winutil: expose Windows policy key 7 months ago
winutil_notwindows.go util/osdiag, util/winutil: expose Windows policy key 7 months ago
winutil_windows.go util/winutil: add support for restarting Windows processes in specific sessions 7 months ago
winutil_windows_test.go go.mod, cmd/tailscaled, ipn/localapi, util/osdiag, util/winutil, util/winutil/authenticode: add Windows module list to OS-specific logs that are written upon bugreport 11 months ago
zsyscall_windows.go util/winutil: add support for restarting Windows processes in specific sessions 7 months ago