[erlang-patches] ssh pty client
Claes Wikstrom
klacke@REDACTED
Fri Aug 15 23:06:48 CEST 2008
Don't know if this is fixed in R12 - we're still at R11. Anyway
the code that allocates a pty from the client side is broken.
This is need for all shell ssh clients. The OTP code has never run.
Here is the patch for R11.
/klacke
Index: ssh_cm.erl
===================================================================
--- ssh_cm.erl (revision 18567)
+++ ssh_cm.erl (working copy)
@@ -1336,8 +1336,12 @@
[{Op, Value} | decode_pty_opts2(Tail)].
-
-encode_pty_opts([{Opt,Value} | Opts]) ->
+encode_pty_opts(Opts) ->
+ B = list_to_binary(encode_pty_opts2(Opts)),
+ Len = size(B),
+ <<?UINT32(Len), B/binary>>.
+
+encode_pty_opts2([{Opt,Value} | Opts]) ->
Code = case Opt of
vintr -> ?VINTR;
vquit -> ?VQUIT;
@@ -1395,8 +1399,8 @@
tty_op_ispeed -> ?TTY_OP_ISPEED;
tty_op_ospeed -> ?TTY_OP_OSPEED
end,
- [Code, ?uint32(Value) | encode_pty_opts(Opts)];
-encode_pty_opts([]) ->
+ [Code, ?uint32(Value) | encode_pty_opts2(Opts)];
+encode_pty_opts2([]) ->
[?TTY_OP_END].
More information about the erlang-patches
mailing list