Hi,

On Fri, Jan 23, 2026 at 11:23:37PM +0100, Simon Josefsson via Bug reports for 
the GNU Internet utilities wrote:
> 
> Thank you for review.  How did you build with TN3270 support?  Does
> anyone know of anyone building with -DTN3270?  I tried ./configure
> CFLAGS=-DTN3270 and it doesn't build for me.  Does it build on any
> reasonable platform?
> 
> One approach here is to remove everything within '#ifdef TN3270' if this
> code is unmaintained, not working, and comes with security concerns.
> 
> Would anyone mis the TN3270 functionality?  Is there any way we can test
> the functionality to gain confidence in it?
> 
> Making all in telnet
> make[2]: Entering directory '/home/jas/src/inetutils/telnet'
>   CC       commands.o
> commands.c: In function 'bye':
> commands.c:1658:7: error: implicit declaration of function 'SetIn3270' 
> [-Wimplicit-function-declaration]
>  1658 |       SetIn3270 ();             /* Get out of 3270 mode */
>       |       ^~~~~~~~~
> commands.c: In function 'status':
> commands.c:2414:30: error: too many arguments to function 'getpgrp'
>  2414 |                   getpid (), getpgrp (getpid ()));
>       |                              ^~~~~~~
> In file included from ../lib/unistd.h:40,
>                  from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
>                  from /usr/include/signal.h:328,
>                  from ../lib/signal.h:52,
>                  from /usr/include/x86_64-linux-gnu/sys/param.h:28,
>                  from commands.c:51:
> /usr/include/unistd.h:656:16: note: declared here
>   656 | extern __pid_t getpgrp (void) __THROW;
>       |                ^~~~~~~
> make[2]: *** [Makefile:2643: commands.o] Error 1

I see the same on Ubuntu GNU/Linux 22.04.

The last error seems to be a compatibility problem between BSD and POSIX:

    $ man getpgrp | \grep getpgrp | sed 's/^ *//;3q'
    setpgid, getpgid, setpgrp, getpgrp - set/get process group
    pid_t getpgrp(void);                 /* POSIX.1 version */
    pid_t getpgrp(pid_t pid);            /* BSD version */

The code seems to assume the BSD prototype, while the system provides the
POSIX.1 version.  According to the man page, the GLibc dropped support
for the BSD variant in version 2.19:

    $ man getpgrp | section -F 'getpgrp() (BSD)' | sed -E 's/^ {7}//'
    setpgrp() (BSD), getpgrp() (BSD):
        [These are available only before glibc 2.19]
        _BSD_SOURCE &&
            ! (_POSIX_SOURCE || _POSIX_C_SOURCE || _XOPEN_SOURCE ||
                _GNU_SOURCE || _SVID_SOURCE)

I think that Gnulib only provides the POSIX version[0], so the respective
code in commands.c would need to be changed to use the POSIX version,
perhaps unless compiled on (or for) BSD.

[0] https://www.gnu.org/software/gnulib/manual/html_node/getpgrp.html

Changing the getpgrp() call to follow POSIX gets further in the
compilation, but it fails in telnet/tn3270.c:

    [...]
    tn3270.c:61:11: fatal error: ../ctlr/screen.h: No such file or directory
       61 | # include "../ctlr/screen.h"
          |           ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:2639: tn3270.o] Error 1

I don't know what that is supposed to be, but there is no ctlr/ directory,
no screen.h header file, and the only function invocation including
"ctlr" is "init_ctlr ();" in telnet/tn3270.c line 101, but I did not
find a definition for it.

The TN3270 support in GNU Inetutils seems to be thoroughly broken.

Cheers,
Erik

  • Stack-based... Veper X
    • Re: St... Simon Josefsson via Bug reports for the GNU Internet utilities
      • Re... Collin Funk
      • Re... Erik Auerswald
        • ... Simon Josefsson via Bug reports for the GNU Internet utilities

Reply via email to