From 2c2393ce72b4199fd4363d044ec4a2266b3928a7 Mon Sep 17 00:00:00 2001 From: james-pickett Date: Mon, 13 Nov 2023 10:42:47 -0800 Subject: [PATCH] more tweaks --- ee/consoleuser/consoleuser_linux.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ee/consoleuser/consoleuser_linux.go b/ee/consoleuser/consoleuser_linux.go index 08c20c6f7..263a94363 100644 --- a/ee/consoleuser/consoleuser_linux.go +++ b/ee/consoleuser/consoleuser_linux.go @@ -41,8 +41,6 @@ func CurrentUids(ctx context.Context) ([]string, error) { return nil, fmt.Errorf("loginctl show-session (for sessionId %s): %w", s.Session, err) } - outputStr := strings.Trim(string(output), "\n") - // to make remote session behave like local session and include systray icons on ubuntu 22.04 // had to create a ~/.xsessionrc file with the following content: // export GNOME_SHELL_SESSION_MODE=ubuntu @@ -53,12 +51,12 @@ func CurrentUids(ctx context.Context) ([]string, error) { // ssh: remote=yes // local: remote=no // rdp: remote=no - if strings.Contains(outputStr, "Remote=yes") { + if !strings.Contains(string(output), "Remote=no") { continue } // don't include inactive users - if strings.Contains(outputStr, "Active=no") { + if !strings.Contains(string(output), "Active=yes") { continue }