Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into becca/more-slog-rep…
Browse files Browse the repository at this point in the history
…lacement
  • Loading branch information
RebeccaMahany committed Feb 23, 2024
2 parents 0b77db0 + 0cfcc24 commit ea53205
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 ea53205

Please sign in to comment.