Skip to content

Commit

Permalink
Do not spin up desktop process for nobody user (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Feb 23, 2024
1 parent d99cd48 commit 0cfcc24
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ee/consoleuser/consoleuser_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (
)

type listSessionsResult []struct {
Session string `json:"session"`
UID int `json:"uid"`
Seat string `json:"seat"`
Session string `json:"session"`
UID int `json:"uid"`
Username string `json:"user"`
Seat string `json:"seat"`
}

func CurrentUids(ctx context.Context) ([]string, error) {
Expand All @@ -36,8 +37,9 @@ func CurrentUids(ctx context.Context) ([]string, error) {

var uids []string
for _, s := range sessions {
// generally human users start at 1000 on linux
if s.UID < 1000 {
// generally human users start at 1000 on linux. 65534 is reserved for https://wiki.ubuntu.com/nobody,
// which we don't want to count as a current user.
if s.UID < 1000 || s.UID == 65534 || s.Username == "nobody" {
continue
}

Expand Down

0 comments on commit 0cfcc24

Please sign in to comment.