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/ipn
Nick Khyl f33f5f99c0 ipn/{ipnlocal,ipnserver}: remove redundant (*LocalBackend).ResetForClientDisconnect
In this commit, we add a failing test to verify that ipn/ipnserver.Server correctly
sets and unsets the current user when two different users connect sequentially
(A connects, A disconnects, B connects, B disconnects).

We then fix the test by updating (*ipn/ipnserver.Server).addActiveHTTPRequest
to avoid calling (*LocalBackend).ResetForClientDisconnect again after a new user
has connected and been set as the current user with (*LocalBackend).SetCurrentUser().

Since ipn/ipnserver.Server does not allow simultaneous connections from different
Windows users and relies on the LocalBackend's current user, and since we already
reset the LocalBackend's state by calling ResetForClientDisconnect when the last
active request completes (indicating the server is idle and can accept connections
from any Windows user), it is unnecessary to track the last connected user on the
ipnserver.Server side or call ResetForClientDisconnect again when the user changes.

Additionally, the second call to ResetForClientDisconnect occurs after the new user
has been set as the current user, resetting the correct state for the new user
instead of the old state of the now-disconnected user, causing issues.

Updates tailscale/corp#25804

Signed-off-by: Nick Khyl <nickk@tailscale.com>
11 months ago
..
conffile ipn/conffile: don't depend on hujson on iOS/Android 1 year ago
ipnauth ipn/{ipnauth,ipnlocal,ipnserver}, client/tailscale: make ipnserver.Server testable 11 months ago
ipnlocal ipn/{ipnlocal,ipnserver}: remove redundant (*LocalBackend).ResetForClientDisconnect 11 months ago
ipnserver ipn/{ipnlocal,ipnserver}: remove redundant (*LocalBackend).ResetForClientDisconnect 11 months ago
ipnstate all: illumos/solaris userspace only support 11 months ago
localapi util/uniq,types/lazy,*: delete code that's now in Go std 11 months ago
policy ipn,tailconfig: clean up unreleased and removed app connector service 2 years ago
store kube/{kubeapi,kubeclient},ipn/store/kubestore,cmd/{containerboot,k8s-operator}: emit kube store Events (#14112) 1 year ago
backend.go ipn: declare NotifyWatchOpt consts without using iota 11 months ago
conf.go ipn/conf.go: add VIPServices to tailscaled configfile (#14345) 11 months ago
doc.go IPN: Update ServeConfig to accept configuration for Services. 1 year ago
ipn_clone.go IPN: Update ServeConfig to accept configuration for Services. 1 year ago
ipn_test.go all: do not depend on the testing package 2 years ago
ipn_view.go cmd/viewer,all: consistently use "read-only" instead of "readonly" 11 months ago
prefs.go cmd/tailscale,ipn,tailcfg: add `tailscale advertise` subcommand behind envknob (#13734) 1 year ago
prefs_test.go cmd/tailscale,ipn,tailcfg: add `tailscale advertise` subcommand behind envknob (#13734) 1 year ago
serve.go ipn/ipnlocal: connect serve config to c2n endpoint 11 months ago
serve_test.go cmd/serve: don't convert localhost to 127.0.0.1 1 year ago
store.go ipn: add comment about thread-safety to StateStore 2 years ago
store_test.go ipn: avoid useless no-op WriteState calls 2 years ago