mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 10:41:19 -08:00
ipn/desktop: skip the extension when sessions can't be enumerated
Registering the session state callback enumerates the existing desktop sessions, which fails for a tailscaled run by an unprivileged user (WTSEnumerateSessions returns "No more data is available"). That was reported as "init failed", which reads like a bug. Such a tailscaled has no other users' sessions to track, so report it as skipping the extension, the same way an unavailable session manager already is. Updates #2791 Signed-off-by: Brad Fitzpatrick <[email protected]> Change-Id: I7f9b1d3e5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b
This commit is contained in:
1 parent
9020fdcd8a
commit
6612bed24d
1 file changed
+5
-1
@@ -101,7 +101,11 @@ func (e *desktopSessionsExt) Init(host ipnext.Host) (err error) {
|
||||
e.host = host
|
||||
unregisterSessionCb, err := e.sm.RegisterStateCallback(e.updateDesktopSessionState)
|
||||
if err != nil {
|
||||
return fmt.Errorf("session callback registration failed: %w", err)
|
||||
// Registering the callback enumerates the existing desktop
|
||||
// sessions, which fails for a tailscaled run by an unprivileged
|
||||
// user. That is not an error worth alarming about: such a
|
||||
// tailscaled has no other users' sessions to track anyway.
|
||||
return fmt.Errorf("%w: session callback registration failed: %w", ipnext.SkipExtension, err)
|
||||
}
|
||||
unregisterPolicyCb, err := e.sm.RegisterInitCallback(e.initUserPolicyStore)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user