On Thursday 06 November 2008 23:49, Cathey, Jim wrote:
> BB telnetd doesn't properly handle 2-byte IAC
> sequences.  (Both in the 1.10 and 1.11 we've used.)
> The following diff is what we've applied, it fixes
> both IAC-IAC (emacs M-DEL) and IAC-NOP (putty keepalive):
> 
> $ diff -c networking/telnetd.c~ networking/telnetd.c
> *** networking/telnetd.c~    2008-11-04 14:40:31.000000000 -0800
> --- networking/telnetd.c     2008-11-06 14:16:51.000000000 -0800
> ***************
> *** 74,82 ****
>      past (bf + len) then that IAC will be left unprocessed and
> *processed
>      will be less than len.
>   
> -    FIXME - if we mean to send 0xFF to the terminal then it will be
> escaped,
> -    what is the escape character?  We aren't handling that situation
> here.
> - 
>      CR-LF ->'s CR mapping is also done here, for convenience.

Patches are linewrapped. Half of them are not in unidiff format.
Also, interspersing patches and email text makes it
even more difficult to extract apllyable patches.
I'd send one patch per apllet to avoit it, and placed
patch as the very last part of the email, or as an attachment.

I do appreciate your help in making busybox better, but
please resend patches in a more readable form.



+       struct sockaddr_in ir_sin;
+       socklen_t size;
+       char envBuf[32];
+ 
+       size = sizeof(ir_sin);
+ 
+       memset(envBuf,0, sizeof envBuf);
+ 
+       // grab the peer IP address before it's gone
+       if (getpeername(sock, (struct sockaddr *) &ir_sin, &size) < 0) {
+          fprintf(stdout, "%s %d getsockname
error\n\r",__FUNCTION__,__LINE__);
+          bb_perror_msg("getsockname");
+       }
+       else
+       {
+          //fprintf(stdout, "%s %d
0x%s\n\r",__FUNCTION__,__LINE__,inet_ntoa(ir_sin.sin_addr));
+          snprintf(envBuf, sizeof envBuf - 1,
"-h%s",inet_ntoa(ir_sin.sin_addr));
+       }
  
        /*ts->buf1 = (char *)(ts + 1);*/
        /*ts->buf2 = ts->buf1 + BUFSIZE;*/

This is not IPv6 clean. There are many examples of IPv6 capable code
in the tree. Like networking/tftp.c, get_sock_lsa() function.

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to