diff options
| author | Gesa Stupperich <gesa@tailscale.com> | 2026-02-10 11:21:24 +0000 |
|---|---|---|
| committer | Gesa Stupperich <gesa@tailscale.com> | 2026-02-11 21:26:59 +0000 |
| commit | c37f648ad27c00abcc0dc8958c8e9722ff9f9d10 (patch) | |
| tree | 1683075c8ff6d384eef98fa504f649beff1b4acc /ssh/tailssh/user.go | |
| parent | db52827a83553122dadc36e4607e9b7a84abb2ec (diff) | |
| download | tailscale-gesa/ssh-crash-local-user.tar.xz tailscale-gesa/ssh-crash-local-user.zip | |
ssh/tailssh: store c.info and c.localUser as valuesgesa/ssh-crash-local-user
This converts the info and localUser fields on the conn from
pointers to values. I consider this an overall improvement since
both structs are small and it makes access safer in cases when
they've not yet been set.
Updates tailscale/corp#36268
Signed-off-by: Gesa Stupperich <gesa@tailscale.com>
Diffstat (limited to 'ssh/tailssh/user.go')
| -rw-r--r-- | ssh/tailssh/user.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh/tailssh/user.go b/ssh/tailssh/user.go index 7da6bb4eb..c84c93821 100644 --- a/ssh/tailssh/user.go +++ b/ssh/tailssh/user.go @@ -36,15 +36,15 @@ func (u *userMeta) GroupIds() ([]string, error) { return osuser.GetGroupIds(&u.User) } -// userLookup is like os/user.Lookup but it returns a *userMeta wrapper +// userLookup is like os/user.Lookup but it returns a userMeta wrapper // around a *user.User with extra fields. -func userLookup(username string) (*userMeta, error) { +func userLookup(username string) (userMeta, error) { u, s, err := osuser.LookupByUsernameWithShell(username) if err != nil { - return nil, err + return userMeta{}, err } - return &userMeta{User: *u, loginShellCached: s}, nil + return userMeta{User: *u, loginShellCached: s}, nil } func (u *userMeta) LoginShell() string { |
