Avoid shell quoting in ssh login fallback

This commit is contained in:
Hassan Raza
2026-05-19 22:23:05 +05:00
parent 8eb76cd315
commit d77c94e3aa
2 changed files with 36 additions and 4 deletions

View File

@@ -87,14 +87,14 @@ using_shell_env() {
execute_with_python() {
if detect_python; then
exec "$python" "-c" "import os; os.execlp('$login_shell', '-' '$shell_name')"
exec "$python" "-c" 'import os, sys; os.execlp(sys.argv[1], "-" + sys.argv[2])' "$login_shell" "$shell_name"
fi
return 1
}
execute_with_perl() {
if detect_perl; then
exec "$perl" "-e" "exec {'$login_shell'} '-$shell_name'"
exec "$perl" "-e" 'exec {$ARGV[0]} ("-" . $ARGV[1])' "$login_shell" "$shell_name"
fi
return 1
}
@@ -215,7 +215,7 @@ prepare_for_exec() {
fi
;;
esac
shell_name=$(command basename $login_shell)
shell_name=$(command basename "$login_shell")
[ -n "$login_cwd" ] && cd "$login_cwd"
}