[Bug 1891021] Re: Specifying a port in telnetrc is not working

Dongho Chang 1891021 at bugs.launchpad.net
Fri Oct 15 04:02:49 UTC 2021


debian bug url updated

** Bug watch added: Debian Bug tracker #996534
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996534

** Changed in: debian
   Importance: Undecided => Unknown

** Changed in: debian
       Status: New => Unknown

** Changed in: debian
 Remote watch: None => Debian Bug tracker #996534

** Package changed: debian => netkit-telnet (Debian)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netkit-telnet in Ubuntu.
https://bugs.launchpad.net/bugs/1891021

Title:
  Specifying  a port in telnetrc is not working

Status in netkit-telnet package in Ubuntu:
  New
Status in netkit-telnet package in Debian:
  Unknown

Bug description:
  
  1) Ubuntu release
   Description:	Ubuntu 18.04.3 LTS
   Release:	18.04
  2) Package version
   telnet:
    Installed: 0.17-41
    Candidate: 0.17-41
    Version table:
   *** 0.17-41 500
          500 http://kr.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
          100 /var/lib/dpkg/status

  3) What expected to happen

   - 1. Specify a port in telnetrc ( $HOME/.telnetrc) as follows
       *  DEFAUT:8023 mode character
   - 2. telnet a host with specific port
       * telnet 192.168.1.1 8023
   - The expected is that "mode character" command is executed as soon as server is connected, according to "man telnet"

  4) What happened instead
    - The command in telnetrc specifying a port is not executed
    - But If not specifying a port, the command is executed as expected

  5) Cause of Bug
    - telnetrc parsing routine ( readrc() function in telnet/command.cc ) has a flaw in comparing the port number of command-line with that of telnetrc
    - To proceed command processing, the result of string compare MUST not negated
    - The patch is as follows
  --- a/telnet/commands.cc
  +++ b/telnet/commands.cc
  @@ -2135,7 +2135,7 @@ static void readrc(const char *m1, const char *m2, const char *port,
                  continue;
       while (fgets(line, sizeof(line), rcfile)) {
          ...
          if (gotmachine == 0) {
              ...
   
              if (line[0] == ':') {
  -               if (!strncasecmp(&line[1], port, lport))
  +               if (strncasecmp(&line[1], port, lport))
                      continue;
                  strncpy(line, &line[lport + 1], sizeof(line) - lport - 1);
              }
             ...
          }
          ...
          process_command(&cmdtab, margc, margv);

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netkit-telnet/+bug/1891021/+subscriptions




More information about the foundations-bugs mailing list