[krbdev.mit.edu #3958] telnet: setupterm() detection fails when dummy -ltermcap exists on system
Public Submitter via RT
rt-comment at krbdev.mit.edu
Thu Jun 29 17:18:31 EDT 2006
Hi,
http://bugs.gentoo.org/show_bug.cgi?id=124405
http://bugs.gentoo.org/show_bug.cgi?id=135288
mit-krb5-1.4.3 has a bug with setupterm() library detection. The
autoconf script src/appl/telnet/configure.in checks whether main()
exists in -ltermcap. However, some Linux machines have a
terminfo-compatibility library called "libtermcap-compat", which sits at
/lib/libtermcap.so, which has some things like tputs_baud_rate() and
ospeed(), but no setupterm(). This causes two problems:
1. A linker failure later on, because it ends up trying to link
"telnet" against -ltermcap instead of the (more useful) -lncurses.
2. A prototype mismatch error, because the internal setupterm() doesn't
match the prototype defined in the ncurses header files. (The "tname"
argument is missing a "const".)
To fix #1, check for "setupterm" in -ltermcap, not "main". See the
attached patch, mit-krb5-setupterm.patch.
To fix #2, add a "const", or "NCURSES_CONST" or whatever. See
http://bugs.gentoo.org/attachment.cgi?id=90193&action=view - I'm not
sure how portable this is, but it fixes compilation on linux with newer
versions of gcc/ncurses. Anyway, fixing #1 causes setupterm() to be
ifdef'ed out anyway, so issue #2 is hidden.
Mark
More information about the krb5-bugs
mailing list