ssh: don't use -l option for shells on OpenBSD

Shells on OpenBSD don't support the -l option. This means that when
handling SSH in-process, we can't give the user a login shell, but this
change at least allows connecting at all.

Updates #13338

Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
Percy Wegmann 2025-02-05 12:01:01 -06:00 committed by Percy Wegmann
parent 0e6d99cc36
commit 3f2bec5f64

View File

@ -1096,8 +1096,8 @@ func (ia *incubatorArgs) loginArgs(loginCmdPath string) []string {
func shellArgs(isShell bool, cmd string) []string {
if isShell {
if runtime.GOOS == freebsd {
// freebsd's shells don't support the "-l" option, so we can't run as a login shell
if runtime.GOOS == freebsd || runtime.GOOS == openbsd {
// bsd shells don't support the "-l" option, so we can't run as a login shell
return []string{}
}
return []string{"-l"}