Skip to content

Commit

Permalink
fix: replace user.Current() with os.Getenv("USER")
Browse files Browse the repository at this point in the history
This commit replaces user.Current() with os.Getenv("USER") as the
user.Current() call provokes a crash due to a bug in glibc (especially)
on older versions / OS.

Signed-off-by: Christian Walter <[email protected]>
  • Loading branch information
walterchris authored and Fabian Wienand committed Apr 22, 2024
1 parent 53b1e10 commit 0eb6e1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/xcontext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ var (

func init() {
hostname, _ = os.Hostname()
curUser, _ = user.Current()
curUser = &user.User{}
curUser.Name = os.Getenv("USER")
}

// Extend converts a standard context to an extended one
Expand Down

0 comments on commit 0eb6e1a

Please sign in to comment.