mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(agent/usershell): check shell on darwin via dscl (#8366)
This commit is contained in:
@@ -27,5 +27,8 @@ func Get(username string) (string, error) {
|
||||
}
|
||||
return parts[6], nil
|
||||
}
|
||||
return "", xerrors.Errorf("user %q not found in /etc/passwd", username)
|
||||
if s := os.Getenv("SHELL"); s != "" {
|
||||
return s, nil
|
||||
}
|
||||
return "", xerrors.Errorf("shell for user %q not found in /etc/passwd or $SHELL", username)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user