From mikpe@REDACTED Wed Jan 2 16:13:10 2008 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 2 Jan 2008 16:13:10 +0100 Subject: [erlang-patches] Patch for erl shell (unix/ttsl_drv.c) SIGWINCH handling (R12B-1 31-Dec-2007) In-Reply-To: <20071231192739.GA22265@localhost.localdomain> References: <20071231192739.GA22265@localhost.localdomain> Message-ID: <18299.43526.356054.721177@harpo.it.uu.se> Patrick Mahoney writes: > This is an attempt to fix the problem described by Matthew > Dempsky: > http://erlang.org/pipermail/erlang-questions/2007-December/031962.html > > The erl shell in Unix does not properly handle terminal > resize events which can result in a misplaced cursor and > other confusion. > > This patch adds two functions to the file > erts/emulator/drivers/unix/ttsl_drv.c > > winch() is registered as the handler for SIGWINCH which is > received on terminal resize events. winch() sets a global > flag "cols_needs_update = TRUE". > > update_cols() is run at the start of each function that uses > the COL() or LINE() macros for calculating cursor positions, > namely the del_chars(), write_buf(), and move_cursor() > functions. It checks the "cols_needs_update" flag, and sets > the "cols" global var to the number returned by > ttysl_get_widow_size(). > > If the terminal is resized after update_cols() but before > use of the COL() macro, then we'll have the same incorrect > cursor problems during that function. > > We don't run ttysl_get_window_size() from the SIGWINCH > handler because it uses ioctl() which is not listed as a > "safe" function for use in signal handlers in the signal(7) > man page. > > That said, the solution would be more elegant if we did call > ttysl_get_window_size() from the signal handler, avoiding > the polling done by update_cols(). The ncurses source > includes a simple test/view.c program that does use ioctl() > in its SIGWINCH handler. It states "This uses functions > that are 'unsafe', but it seems to work on SunOS and Linux." > Doing this in erl works for me on Linux, but I have no idea > on which platforms if may fail. Calling ioctl() from a signal handler should work on any proper *NIX, including Linux/Solaris/*BSD/AIX. I would however worry about doing this in POSIX emulation environments. I guess cygwin is the prime current example but I think there also used to be one for VMS (if anyone cares). But there is another reason for not blindly updating cols from a signal handler: many procedures reference cols multiple times, and an asynchronous change to cols would break things. For example: > @@ -598,6 +607,8 @@ > { > int dc, dl; > > + update_cols(); > + > dc = COL(to) - COL(from); > dl = LINE(to) - LINE(from); > if (dl > 0) A change to cols between the assignments to dc and dl would make them inconsistent, and a change to cols between COL(to) and COL(from) would make dc bogus. To poll at the beginning of each cols-sensitive output procedure is probably the best short-term solution. Longer-term someone needs to decide what SIGWINCH during tty output means and how to handle it. Maybe ^L + redraw is the proper thing to do. From dot@REDACTED Wed Jan 2 18:05:00 2008 From: dot@REDACTED (Tony Finch) Date: Wed, 2 Jan 2008 17:05:00 +0000 Subject: [erlang-patches] Patch for erl shell (unix/ttsl_drv.c) SIGWINCH handling (R12B-1 31-Dec-2007) In-Reply-To: <18299.43526.356054.721177@harpo.it.uu.se> References: <20071231192739.GA22265@localhost.localdomain> <18299.43526.356054.721177@harpo.it.uu.se> Message-ID: On Wed, 2 Jan 2008, Mikael Pettersson wrote: > > Calling ioctl() from a signal handler should work on any > proper *NIX, including Linux/Solaris/*BSD/AIX. No, it isn't listed as async signal safe by POSIX. See the table near the bottom of http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html Tony. -- f.a.n.finch http://dotat.at/ NORTH FITZROY SOLE: SOUTHEAST BECOMING CYCLONIC 5 TO 7, OCCASIONALLY GALE 8 IN SOLE. VERY ROUGH OR HIGH. RAIN OR SHOWERS. MODERATE OR GOOD, OCCASIONALLY POOR. From fw@REDACTED Thu Jan 3 11:10:30 2008 From: fw@REDACTED (Florian Weimer) Date: Thu, 03 Jan 2008 11:10:30 +0100 Subject: [erlang-patches] Patch for erl shell (unix/ttsl_drv.c) SIGWINCH handling (R12B-1 31-Dec-2007) In-Reply-To: (Tony Finch's message of "Wed, 2 Jan 2008 17:05:00 +0000") References: <20071231192739.GA22265@localhost.localdomain> <18299.43526.356054.721177@harpo.it.uu.se> Message-ID: <871w8zmd7t.fsf@mid.deneb.enyo.de> * Tony Finch: > On Wed, 2 Jan 2008, Mikael Pettersson wrote: >> >> Calling ioctl() from a signal handler should work on any >> proper *NIX, including Linux/Solaris/*BSD/AIX. > > No, it isn't listed as async signal safe by POSIX. See the table near the > bottom of > http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html POSIX only describes the STREAMS ioctl, which is not implemented by Linux (and probably not by the BSDs, either). From mbj@REDACTED Thu Jan 3 11:28:21 2008 From: mbj@REDACTED (Martin Bjorklund) Date: Thu, 03 Jan 2008 11:28:21 +0100 (CET) Subject: [erlang-patches] snmp_pdus.erl patch Message-ID: <20080103.112821.199451041.mbj@tail-f.com> Hi, There is a bug in snmp_pdus:enc_oct_str_tag/1. All the enc_* functions are supposed to return a flat list, but the second clause of this function does not. If it gets a binary it returns a deep list. Change: enc_oct_str_tag(OStr) when list(OStr) -> lists:append([4|elength(length(OStr))],OStr); enc_oct_str_tag(OBin) -> [4,elength(size(OBin)),OBin]. Into: enc_oct_str_tag(OStr) when list(OStr) -> lists:append([4|elength(length(OStr))],OStr); enc_oct_str_tag(OBin) -> [4|elength(size(OBin))]++binary_to_list(OBin). /martin From dot@REDACTED Thu Jan 3 14:36:35 2008 From: dot@REDACTED (Tony Finch) Date: Thu, 3 Jan 2008 13:36:35 +0000 Subject: [erlang-patches] Patch for erl shell (unix/ttsl_drv.c) SIGWINCH handling (R12B-1 31-Dec-2007) In-Reply-To: <871w8zmd7t.fsf@mid.deneb.enyo.de> References: <20071231192739.GA22265@localhost.localdomain> <18299.43526.356054.721177@harpo.it.uu.se> <871w8zmd7t.fsf@mid.deneb.enyo.de> Message-ID: On Thu, 3 Jan 2008, Florian Weimer wrote: > > POSIX only describes the STREAMS ioctl, which is not implemented by > Linux (and probably not by the BSDs, either). The BSD and Solaris manuals list the syscalls that are async-signal-safe and ioctl isn't one of them. Linux appears not to be sufficiently carefully documented to say either way. Tony. -- f.a.n.finch http://dotat.at/ VIKING: SOUTHEAST 6 TO GALE 8, PERHAPS SEVERE GALE 9 LATER. ROUGH OR VERY ROUGH, OCCASIONALLY HIGH IN SOUTHWEST LATER. WINTRY SHOWERS. GOOD. From matthew@REDACTED Tue Jan 8 21:55:39 2008 From: matthew@REDACTED (Matthew Dempsky) Date: Tue, 8 Jan 2008 12:55:39 -0800 Subject: [erlang-patches] unix/sys_float.c mishandles errno Message-ID: The code in unix/sys_float.c assumes that if strtod(3) sets errno to ERANGE then there was a problem parsing the value. However, according to POSIX, the actual indication of an error is that it also returned 0.0, HUGE_VAL, or -HUGE_VAL. This causes a problem on OS X 10.5 when trying to read denormalized floating-point numbers because OS X's strtod(3) implementation sets errno to ERANGE for denormals. The patch below changes the errno check to be consistent with POSIX. --- sys_float.c.orig 2008-01-02 10:38:16.000000000 -0800 +++ sys_float.c 2008-01-02 10:39:55.000000000 -0800 @@ -705,9 +705,7 @@ if (*s) /* That should be it */ return -1; -#ifdef NO_FPE_SIGNALS errno = 0; -#endif __ERTS_FP_CHECK_INIT(fpexnp); *fp = strtod(buf, &t); __ERTS_FP_ERROR_THOROUGH(fpexnp, *fp, return -1); @@ -720,14 +718,14 @@ __ERTS_FP_ERROR_THOROUGH(fpexnp, *fp, return -1); } + if ((*fp == 0.0 || *fp == HUGE_VAL || *fp == -HUGE_VAL) && errno == ERANGE) { #ifdef DEBUG - if (errno == ERANGE) fprintf(stderr, "errno = ERANGE in list_to_float\n\r"); #endif #ifdef NO_FPE_SIGNALS - if (errno == ERANGE) return -1; #endif + } /* ** Replaces following code: ** if (errno == ERANGE) { From ingela@REDACTED Wed Jan 9 09:57:26 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Wed, 09 Jan 2008 09:57:26 +0100 Subject: [erlang-patches] yet another ssh bug In-Reply-To: <4775024E.2090408@hyber.org> References: <4775024E.2090408@hyber.org> Message-ID: <47848C76.5040407@erix.ericsson.se> Well, we can not have it this way now can we ;) Thank you for the patch. We will fix this. Regards Ingela -OTP team Claes Wikstrom wrote: > This fatso bug is also triggered by the putty 0.60 client > > Whenever recv_msg() returns an actual error, we loop > indefinitely. Tcp_closed is never received, since it is already > received when we were in passive mode. > > It basically means that all all OTP ssh systems out there > that expose ssh outwards can be easily brought out of > service simply by trying to connect with putty 0.60 to them > and then exit putty. > > > > Index: ssh_transport.erl > =================================================================== > --- ssh_transport.erl (revision 14365) > +++ ssh_transport.erl (working copy) > @@ -733,9 +733,17 @@ > inet:setopts(S, [{active, once}]), > ssh_main(S, User, SSH); > {error, _Other} -> > - inet:setopts(S, [{active, once}]), > - %% send disconnect! > - ssh_main(S, User, SSH) > + %% socket may or may not be closed, regardless > + %% we close again > + %% discon msg may be sent. > + User ! { > + ssh_msg, self(), > + #ssh_msg_disconnect { > + code=?SSH_DISCONNECT_CONNECTION_LOST, > + description = "Connection closed", > + language = "" }}, > + gen_tcp:close(S), > + ok > end; > > > > /klacke > > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches > > From arturmatos78@REDACTED Sat Jan 12 14:53:55 2008 From: arturmatos78@REDACTED (Artur Matos) Date: Sat, 12 Jan 2008 22:53:55 +0900 Subject: [erlang-patches] jinterface patch - connect to epmd using the loopback address Message-ID: Hi, In the current jinterface implementation, OtpEpmd.publishPort(node) connects to the local epmd using the host's current IP address instead of the loopback address (127.0.0.1). If the host is connected to the internet with a static IP address, this will make the connection to epmd go through the host's firewall, at least in Mac OS X. Besides being a waste of resources, this forces the user to have the epmd port open (creating an unnecessary security risk), and seems inconsistent with Erlang semantics. For example, in my machine, If I invoke "erl -sname blah" in my shell, Erlang connects to epmd without requiring its port to be open (but I have only started using Erlang quite recently, so please correct me if I am wrong). Anyway, the following patch fixes this problem. The patched version works perfectly in Mac OS X, and should behave the same in other platforms, but I didn't test it with any other OS: --- OtpEpmd.java.orig 2000-08-22 21:01:24.000000000 +0900 +++ OtpEpmd.java 2008-01-12 21:51:30.000000000 +0900 @@ -137,7 +137,7 @@ Socket s = null; try { - s = new Socket(InetAddress.getLocalHost(),epmdPort); + s = new Socket(InetAddress.getByName("localhost"),epmdPort); OtpOutputStream obuf = new OtpOutputStream(); obuf.write2BE(node.alive().length() + 1); obuf.write1(stopReq); @@ -289,7 +289,7 @@ try { OtpOutputStream obuf = new OtpOutputStream(); - s = new Socket(InetAddress.getLocalHost(),epmdPort); + s = new Socket(InetAddress.getByName("localhost"),epmdPort); obuf.write2BE(node.alive().length() + 3); @@ -349,7 +349,7 @@ try { OtpOutputStream obuf = new OtpOutputStream(); - s = new Socket(InetAddress.getLocalHost(),epmdPort); + s = new Socket(InetAddress.getByName("localhost"),epmdPort); obuf.write2BE(node.alive().length() + 13); Artur From vances@REDACTED Mon Jan 14 19:48:59 2008 From: vances@REDACTED (Vance Shipley) Date: Mon, 14 Jan 2008 13:48:59 -0500 Subject: [erlang-patches] Incorrect option name used in gs Message-ID: <20080114184830.GA1793@h216-235-12-173.host.egate.net> The patch below corrects the syntax of a configuration for a Tk widget. With current versions of Tcl/Tk an error message is sometimes displayed when using gs applications: gs error: gstk_port_handler: error in input : unknown option "-sta" This is caused by the use of an abbreviated version of the option which controls the state of a (button) widget. As far back as Tk version 4.1 it was always documented this way. I'm not sure when the abbreviated version stopped working, assuming it once did, however the full length version has always been the documented method (AFAICT). The patch below has been tested and does resolve the problem. -Vance --- ./lib/gs/src/gstk_editor.erl 2008-01-14 13:33:30.000000000 -0500 +++ ./lib/gs/src/gstk_editor.erl 2008-01-14 13:33:49.000000000 -0500 @@ -253,8 +253,8 @@ {bad_result,Re} -> {error,{no_such_file,editor,save,F2,Re}} end; - {enable, true} -> {c, [Editor, " conf -sta normal"]}; - {enable, false} -> {c, [Editor, " conf -sta disabled"]}; + {enable, true} -> {c, [Editor, " conf -state normal"]}; + {enable, false} -> {c, [Editor, " conf -state disabled"]}; {setfocus, true} -> {c, ["focus ", Editor]}; {setfocus, false} -> {c, ["focus ."]}; From raimo+erlang-patches@REDACTED Tue Jan 15 12:11:43 2008 From: raimo+erlang-patches@REDACTED (Raimo Niskanen) Date: Tue, 15 Jan 2008 12:11:43 +0100 Subject: [erlang-patches] jinterface patch - connect to epmd using the loopback address In-Reply-To: References: Message-ID: <20080115111143.GA4245@erix.ericsson.se> On Sat, Jan 12, 2008 at 10:53:55PM +0900, Artur Matos wrote: > Hi, > > In the current jinterface implementation, OtpEpmd.publishPort(node) > connects to the local epmd using the > host's current IP address instead of the loopback address (127.0.0.1). > > If the host is connected to the internet with a static IP address, > this will make > the connection to epmd go through the host's firewall, at least in > Mac OS X. Besides being > a waste of resources, this forces the user to have the epmd port > open (creating an unnecessary security risk), > and seems inconsistent with Erlang semantics. For example, in my > machine, If I invoke > "erl -sname blah" in my shell, Erlang connects to epmd without > requiring its port to be open (but I have only started > using Erlang quite recently, so please correct me if I am wrong). > > Anyway, the following patch fixes this problem. > The patched version works perfectly in Mac OS X, and should behave > the same in other platforms, but I didn't test it with any other OS: > Thank you for your patch. I have now checked the behaviour for Erlang itself as well as erl_interface, and it seems Jinterface is alone in error. Your patch will probably be accepted as it is, I will just check that it does not break any test cases and that you have not missed any places needing the same change. (The Jinterface code is well structured, so I do not think so) > --- OtpEpmd.java.orig 2000-08-22 21:01:24.000000000 +0900 > +++ OtpEpmd.java 2008-01-12 21:51:30.000000000 +0900 > @@ -137,7 +137,7 @@ > Socket s = null; > > try { > - s = new Socket(InetAddress.getLocalHost(),epmdPort); > + s = new Socket(InetAddress.getByName("localhost"),epmdPort); > OtpOutputStream obuf = new OtpOutputStream(); > obuf.write2BE(node.alive().length() + 1); > obuf.write1(stopReq); > @@ -289,7 +289,7 @@ > > try { > OtpOutputStream obuf = new OtpOutputStream(); > - s = new Socket(InetAddress.getLocalHost(),epmdPort); > + s = new Socket(InetAddress.getByName("localhost"),epmdPort); > > obuf.write2BE(node.alive().length() + 3); > > @@ -349,7 +349,7 @@ > > try { > OtpOutputStream obuf = new OtpOutputStream(); > - s = new Socket(InetAddress.getLocalHost(),epmdPort); > + s = new Socket(InetAddress.getByName("localhost"),epmdPort); > > obuf.write2BE(node.alive().length() + 13); > > > > > Artur > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From dgud@REDACTED Tue Jan 22 14:17:07 2008 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 22 Jan 2008 14:17:07 +0100 Subject: [erlang-patches] Update gs to use newly available Tcl/Tk v8.5 In-Reply-To: <20071224043709.GG1590@little-black-book.motivity.ca> References: <20071224043709.GG1590@little-black-book.motivity.ca> Message-ID: <4795ECD3.1000707@erix.ericsson.se> Added thanks. /Dan Vance Shipley wrote: > The latest version of Tcl/Tk improves the way gs works on > some environments (notably OS X). The standard installed > program name is now "wish8.5". The following patch adds > this name to the search so that the newer version will be > used if installed. > > I tried adding support for an environment variable but I > found out how deep that rabbit hole goes ... > > -Vance > > > --- lib/gs/src/gstk_port_handler.erl 2007-12-23 23:30:08.000000000 -0500 > +++ lib/gs/src/gstk_port_handler.erl 2007-11-26 14:03:00.000000000 -0500 > @@ -39,7 +39,7 @@ > % FIXME There has to be a better solution.... > % FIXME Add option in app file or environmen variable. > > --define(WISHNAMES, ["wish8.5", "wish84","wish8.4", > +-define(WISHNAMES, ["wish84","wish8.4", > "wish83","wish8.3", > "wish82","wish8.2", > "wish"]). > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches > From dgud@REDACTED Tue Jan 22 14:17:36 2008 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 22 Jan 2008 14:17:36 +0100 Subject: [erlang-patches] Incorrect option name used in gs In-Reply-To: <20080114184830.GA1793@h216-235-12-173.host.egate.net> References: <20080114184830.GA1793@h216-235-12-173.host.egate.net> Message-ID: <4795ECF0.5030709@erix.ericsson.se> Added, thanks. /Dan Vance Shipley wrote: > The patch below corrects the syntax of a configuration for a Tk widget. > With current versions of Tcl/Tk an error message is sometimes displayed > when using gs applications: > > gs error: gstk_port_handler: error in input : unknown option "-sta" > > This is caused by the use of an abbreviated version of the option > which controls the state of a (button) widget. As far back as Tk > version 4.1 it was always documented this way. I'm not sure when > the abbreviated version stopped working, assuming it once did, however > the full length version has always been the documented method (AFAICT). > > The patch below has been tested and does resolve the problem. > > -Vance > > --- ./lib/gs/src/gstk_editor.erl 2008-01-14 13:33:30.000000000 -0500 > +++ ./lib/gs/src/gstk_editor.erl 2008-01-14 13:33:49.000000000 -0500 > @@ -253,8 +253,8 @@ > {bad_result,Re} -> > {error,{no_such_file,editor,save,F2,Re}} > end; > - {enable, true} -> {c, [Editor, " conf -sta normal"]}; > - {enable, false} -> {c, [Editor, " conf -sta disabled"]}; > + {enable, true} -> {c, [Editor, " conf -state normal"]}; > + {enable, false} -> {c, [Editor, " conf -state disabled"]}; > > {setfocus, true} -> {c, ["focus ", Editor]}; > {setfocus, false} -> {c, ["focus ."]}; > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches > From bjorn@REDACTED Thu Jan 24 10:35:40 2008 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 24 Jan 2008 10:35:40 +0100 Subject: [erlang-patches] unix/sys_float.c mishandles errno In-Reply-To: References: Message-ID: "Matthew Dempsky" writes: > The code in unix/sys_float.c assumes that if strtod(3) sets errno to > ERANGE then there was a problem parsing the value. However, according > to POSIX, the actual indication of an error is that it also returned > 0.0, HUGE_VAL, or -HUGE_VAL. This causes a problem on OS X 10.5 when > trying to read denormalized floating-point numbers because OS X's > strtod(3) implementation sets errno to ERANGE for denormals. > > The patch below changes the errno check to be consistent with POSIX. Thanks! We will test the patch in our daily build and include it in R12B-1 if we'll encounter no problems. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From vances@REDACTED Mon Jan 28 19:57:54 2008 From: vances@REDACTED (Vance Shipley) Date: Mon, 28 Jan 2008 13:57:54 -0500 Subject: [erlang-patches] binarybytes Message-ID: <20080128185754.GC149@h216-235-12-171.host.egate.net> http://erlang.org/doc/reference_manual/expressions.html#6.16 Type= integer| float|binarybytes|bitstring|bits ^^^^^^^^^^^ There is a missing seperator between binary and bytes. It should read: Type= integer| float|binary|bytes|bitstring|bits The default is integer, bytes is a shorthand for binary and bits is a shorthand for bitstring -Vance From erlang@REDACTED Tue Jan 29 11:09:25 2008 From: erlang@REDACTED (Peter Lund) Date: Tue, 29 Jan 2008 11:09:25 +0100 Subject: [erlang-patches] Putty and erlang sshd fix Message-ID: <479EFB55.2020404@lundata.se> I guess we should send this here as well... /Peter Peter Lund wrote: > Testade med putty 0.59 och 0.60, men ssh_sshd servern krashade > fortfarande. > Servern krashar d? putty skickar en ensam tv?a <<2>> (SSH_MSG_IGNORE) men > servern f?rv?ntar sig en str?ng efter IGNORE. > > Sj?lv la jag till ytterligare en patch f?r att f? servern att > acceptera b?de en > ensam IGNORE och en IGNORE med en str?ng. Med patchen neda fick jag > ssh att funka. Known 0.59 putty bug, putyy skickar IGNORE utan extra data. Om vi ska vara putty bug-kompatibla s? ?r din patch n?stan ok. F?r att #ssh_msg_ignore{} ska bli r?tt m?ste dock patchen se ut som: Index: ssh_bits.erl =================================================================== --- ssh_bits.erl (revision 14434) +++ ssh_bits.erl (working copy) @@ -259,11 +259,16 @@ <<_:Offset/binary, _:16, _:Pad, X:Bits/big-unsigned-integer, _/binary>> = Binary, decode(Binary, Offset+2+L, Ts, [X | Acc]); - string -> - <<_:Offset/binary,?UINT32(L), X:L/binary,_/binary>> = Binary, - decode(Binary, Offset+4+L, Ts, [binary_to_list(X) | Acc]); - + Size = size(Binary), + if Size < Offset + 4 -> + %% empty string at end + {Size, reverse(["" | Acc])}; + true -> + <<_:Offset/binary,?UINT32(L), X:L/binary,_/binary>> = + Binary, + decode(Binary, Offset+4+L, Ts, [binary_to_list(X) | Acc]) + end; binary -> <<_:Offset/binary,?UINT32(L), X:L/binary,_/binary>> = Binary, decode(Binary, Offset+4+L, Ts, [X | Acc]); /klacke From ingela@REDACTED Thu Jan 31 15:47:30 2008 From: ingela@REDACTED (Ingela Anderton Andin) Date: Thu, 31 Jan 2008 15:47:30 +0100 Subject: [erlang-patches] Putty and erlang sshd fix In-Reply-To: <479EFB55.2020404@lundata.se> References: <479EFB55.2020404@lundata.se> Message-ID: <47A1DF82.2060905@erix.ericsson.se> Hi! Thank you we will change ssh so that ssh_ignore will be correct. Regards Ingela - OTP team Peter Lund wrote: > I guess we should send this here as well... > > /Peter > > > > Peter Lund wrote: > > >> Testade med putty 0.59 och 0.60, men ssh_sshd servern krashade >> fortfarande. >> Servern krashar d? putty skickar en ensam tv?a <<2>> (SSH_MSG_IGNORE) men >> servern f?rv?ntar sig en str?ng efter IGNORE. >> >> Sj?lv la jag till ytterligare en patch f?r att f? servern att >> acceptera b?de en >> ensam IGNORE och en IGNORE med en str?ng. Med patchen neda fick jag >> ssh att funka. >> > > Known 0.59 putty bug, putyy skickar IGNORE utan extra data. Om vi ska > vara putty > bug-kompatibla s? ?r din patch n?stan ok. F?r att #ssh_msg_ignore{} ska > bli r?tt m?ste > dock patchen se ut som: > > Index: ssh_bits.erl > =================================================================== > --- ssh_bits.erl (revision 14434) > +++ ssh_bits.erl (working copy) > @@ -259,11 +259,16 @@ > <<_:Offset/binary, _:16, _:Pad, X:Bits/big-unsigned-integer, > _/binary>> = Binary, > decode(Binary, Offset+2+L, Ts, [X | Acc]); > - > string -> > - <<_:Offset/binary,?UINT32(L), X:L/binary,_/binary>> = Binary, > - decode(Binary, Offset+4+L, Ts, [binary_to_list(X) | Acc]); > - > + Size = size(Binary), > + if Size < Offset + 4 -> > + %% empty string at end > + {Size, reverse(["" | Acc])}; > + true -> > + <<_:Offset/binary,?UINT32(L), X:L/binary,_/binary>> = > + Binary, > + decode(Binary, Offset+4+L, Ts, [binary_to_list(X) | > Acc]) > + end; > binary -> > <<_:Offset/binary,?UINT32(L), X:L/binary,_/binary>> = Binary, > decode(Binary, Offset+4+L, Ts, [X | Acc]); > > > > /klacke > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches > >