commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-30-gc41f6d


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-30-gc41f6df
Date: Mon, 27 Feb 2017 17:44:09 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  c41f6dfcd469d1e41c3fcf924607016d9d983a0b (commit)
       via  9d646ac0f01a29e32e25389ff7ddcd7c5e3c0515 (commit)
      from  127a8a349168cfc91bd3699f911c5de42e5863aa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=c41f6dfcd469d1e41c3fcf924607016d9d983a0b


commit c41f6dfcd469d1e41c3fcf924607016d9d983a0b
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Feb 27 23:20:12 2017 +0100

    telnetd: Portability of TTY termcap to Solaris.

diff --git a/ChangeLog b/ChangeLog
index f5e3d4a..c632d86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2017-02-27  Mats Erik Andersson  <address@hidden>
 
+       telnetd: Portability of TTY termcap to Solaris systems.
+
+       * telnetd/term.c: Include header <fcntl.h>.
+       [SOLARIS10 || SOLARIS] (init_termbuf): If applicable, open
+       the slave TTY and extract terminal capabilities, since these
+       systems do not assign a line discipline to the master PTY.
+       New variables NAME and TTY.
+
+2017-02-27  Mats Erik Andersson  <address@hidden>
+
        telnetd: Portable option debugging.
        BSD systems assign IAC and _POSIX_VDISABLE the common decimal
        value 255. Hence the NVT enforces value duplication more often
diff --git a/telnetd/term.c b/telnetd/term.c
index 6badbe8..a190e28 100644
--- a/telnetd/term.c
+++ b/telnetd/term.c
@@ -21,6 +21,8 @@
 
 #include <telnetd.h>
 
+#include <fcntl.h>
+
 typedef struct termios TERMDESC;
 #define _term_getattr tcgetattr
 #define _term_setattr(fd, tp) tcsetattr (fd, TCSANOW, tp)
@@ -213,7 +215,7 @@ tty_iscrnl ()
   return termbuf.sg.sg_flags & CRMOD;
 }
 
-#else
+#else /* !IOCTL_INTERFACE */
 
 # define termdesc_eofc    c_cc[VEOF]
 # define termdesc_erase   c_cc[VERASE]
@@ -496,12 +498,36 @@ tty_iscrnl (void)
   return termbuf.c_iflag & ICRNL;
 }
 
-#endif
+#endif /* !IOCTL_INTERFACE */
 
 void
 init_termbuf (void)
 {
+#if defined SOLARIS10 || defined SOLARIS
+  /* On Solaris the master PTY is not able to report terminal
+   * settings about the slave TTY, since it is only the slave
+   * that is working with an designated line discipline.
+   * Therefore we must determine the slave descriptor, which
+   * exists only if ptsname() returns a non-empty string.
+   * This happens for the parent process.  The child process
+   * sees an empty name, so undergoes minimal processing.
+   */
+  char *name = ptsname(pty);
+
+  if (!name)
+    _term_getattr (pty, &termbuf);
+  else
+    {
+      /* Minimal access means read only!  */
+      int tty = open(name, O_RDONLY | O_NONBLOCK);
+
+      _term_getattr (tty, &termbuf);
+      close(tty);
+    }
+#else /* !SOLARIS && !SOLARIS10 */
   _term_getattr (pty, &termbuf);
+#endif
+
   termbuf2 = termbuf;
 }
 

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=9d646ac0f01a29e32e25389ff7ddcd7c5e3c0515


commit 9d646ac0f01a29e32e25389ff7ddcd7c5e3c0515
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Feb 27 23:03:36 2017 +0100

    telnetd: Portable option debugging.
    
    Also report locally unsupported editing characters
    as free for the client to choose at his own will

diff --git a/ChangeLog b/ChangeLog
index a423584..f5e3d4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2017-02-27  Mats Erik Andersson  <address@hidden>
+
+       telnetd: Portable option debugging.
+       BSD systems assign IAC and _POSIX_VDISABLE the common decimal
+       value 255. Hence the NVT enforces value duplication more often
+       during their transmission, than GNU and Solaris systems do.
+
+       * telnetd/utility.c (printsub) <LM_SLC>: Increase suboption
+       pointer I sufficiently to counteract duplication.  This has
+       to distinguish between in/out/none.  In recursive mode,
+       suppress newline at the end of suboption printing.
+
+       * telnetd/slc.c (send_slc) <SLC_EC, SLC_EL, SLC_EW, SLC_RP>
+       <SLC_LNEXT>: Editing characters are reported using SLC_DEFAULT
+       rather than ignored due to SLC_NOSUPPORT, when they are not
+       supported locally.  This conforms with RFC 1184, section 2.4.
+       The test for support checks the set 'current', not 'defset',
+       which fits the wording found in RFC 1184.
+
 2017-02-23  Mats Erik Andersson  <address@hidden>
 
        telnetd: Scrub USER from environment.
diff --git a/telnetd/slc.c b/telnetd/slc.c
index 1b9f104..3f83f12 100644
--- a/telnetd/slc.c
+++ b/telnetd/slc.c
@@ -73,14 +73,37 @@ send_slc (void)
   /*
    * Send out list of triplets of special characters
    * to client.  We only send info on the characters
-   * that are currently supported.
+   * that are currently supported, except that editing
+   * characters without current support are conveyed
+   * using SLC_DEFAULT, thus urging the client to make
+   * a choice of his own.  This conforms to RFC 1184,
+   * section 2.4, page 6.
    */
   for (i = 1; i <= NSLC; i++)
     {
-      if ((slctab[i].defset.flag & SLC_LEVELBITS) == SLC_NOSUPPORT)
-       continue;
-      add_slc ((unsigned char) i, slctab[i].current.flag,
-              slctab[i].current.val);
+      if ((slctab[i].current.flag & SLC_LEVELBITS) != SLC_NOSUPPORT)
+       add_slc ((unsigned char) i, slctab[i].current.flag,
+                slctab[i].current.val);
+      else
+       {
+         /* Urge the client to choose sensible editing characters.  */
+         switch (i)
+           {
+           case SLC_EC:
+           case SLC_EL:
+           case SLC_EW:
+           case SLC_RP:
+           case SLC_LNEXT:
+             add_slc ((unsigned char) i,
+                      (slctab[i].current.flag & ~SLC_LEVELBITS) | SLC_DEFAULT,
+                       0);
+             break;
+
+           default:
+             /* Be silent on other, unsupported characters.  */
+             break;
+           }
+       }
     }
 
 }                              /* end of send_slc */
diff --git a/telnetd/utility.c b/telnetd/utility.c
index 69faf7d..35b19f7 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -1196,9 +1196,21 @@ printsub (int direction, unsigned char *pointer, int 
length)
                debug_output_data ("(0x%x)", pointer[i + SLC_FLAGS]);
              debug_output_data (" %d;", pointer[i + SLC_VALUE]);
 
+             /* Protocol enforced duplication of IAC depends on pre
+              * and post modification of data, hence differs between
+              * in, out, and no direction, i.e., recursive mode.
+              * Some systems assign _POSIX_VDISABLE and IAC the same
+              * value!  Heuristic experiments led to the following.
+              * Recursive mode needs both steps as written here.
+              */
              if ((pointer[i + SLC_VALUE] == IAC) &&
-                 (pointer[i + SLC_VALUE + 1] == IAC))
+                 (pointer[i + SLC_VALUE + 1] == IAC) &&
+                 (direction != '<'))
                i++;
+             if ((pointer[i + SLC_VALUE] == IAC) &&
+                 (pointer[i + SLC_VALUE + 1] == IAC) &&
+                 !direction)
+               i += 2;
            }
 
          for (; i < length; i++)
@@ -1572,7 +1584,12 @@ printsub (int direction, unsigned char *pointer, int 
length)
        debug_output_data (" %d", pointer[i]);
       break;
     }
-  debug_output_data ("\r\n");
+
+  /* Without direction, we are doing a recursive suboption printing.
+   * Suppress NL, which would otherwise misplace the SE marker.
+   */
+  if (direction)
+    debug_output_data ("\r\n");
 }
 
 /*

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         | 29 +++++++++++++++++++++++++++++
 telnetd/slc.c     | 33 ++++++++++++++++++++++++++++-----
 telnetd/term.c    | 30 ++++++++++++++++++++++++++++--
 telnetd/utility.c | 21 +++++++++++++++++++--
 4 files changed, 104 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]