Files
Andrew LytvynovandAaron Klotz 6abb425482 ipn/ipnauth: improve the Windows token administrator check (#10755)
(*Token).IsAdministrator is supposed to return true even when the user is
running with a UAC limited token. The idea is that, for the purposes of
this check, we don't care whether the user is *currently* running with
full Admin rights, we just want to know whether the user can
*potentially* do so.

We accomplish this by querying for the token's "linked token," which
should be the fully-elevated variant, and checking its group memberships.

We also switch ipn/ipnserver/(*Server).connIsLocalAdmin to use the elevation
check to preserve those semantics for tailscale serve; I want the
IsAdministrator check to be used for less sensitive things like toggling
auto-update on and off.

Updates tailscale/corp#15405

Signed-off-by: Aaron Klotz <[email protected]>
Co-authored-by: Aaron Klotz <[email protected]>
2024-01-05 11:09:37 -08:00
..