mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 04:06:35 +02:00
ssh/tailssh: case insensitive unix user matching
This commit is contained in:
parent
54606a0a89
commit
d0d40fb668
@ -1197,6 +1197,14 @@ func mapLocalUser(ruleSSHUsers map[string]string, reqSSHUser string) (localUser
|
||||
if !ok {
|
||||
v = ruleSSHUsers["*"]
|
||||
}
|
||||
// We check whether the lowercased system user (i.e. unix user)
|
||||
// matches any of the listed ssh users. This is done because the
|
||||
// all users in ssh.[].users are normalized to lowercase, but the
|
||||
// user email addresse username may originally be mixed case (e.g.
|
||||
// "Bob@example.com"). This is especially true for SCIM users.
|
||||
if _, ok := ruleSSHUsers[strings.ToLower(reqSSHUser)]; ok {
|
||||
v = reqSSHUser // use the potentially-mixed case user.
|
||||
}
|
||||
if v == "=" {
|
||||
return reqSSHUser
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user