ssh/tailssh: fix regression after LDAP support

58ab66ec51 added LDAP support
for #4945 by shelling out to getdent.

It was supposed to fall back to the old method when getdent wasn't
found, but some variable name confusion (uid vs username) meant the
old path wasn't calling the right lookup function (user.LookupId
instead of user.Lookup).

Which meant that changed probably also broke FreeBSD and macOS SSH
support in addition to the reported OpenWRT regression.

The gokrazy support didn't look right either.

Fixes #8180

Change-Id: I273bbe96fe98b2517fbf0335fd476b483c051554
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-05-21 07:35:33 -07:00
committed by Brad Fitzpatrick
parent e3cb982139
commit a4fd4fd845
2 changed files with 22 additions and 15 deletions

View File

@@ -851,7 +851,7 @@ func TestSSH(t *testing.T) {
if err != nil {
t.Fatal(err)
}
um, err := userLookup(u.Uid)
um, err := userLookup(u.Username)
if err != nil {
t.Fatal(err)
}