From c5bb34bd1abf355fe7c8e2aeeb780b7b68ad9193 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 14 May 1998 04:57:00 +0000 Subject: [PATCH] telnetd.c (main): telnetd-ktd.c (main): POSIX states that getopt returns -1 when it is done parsing options, not EOF. configure.in: Rename HAS_* to HAVE_* for the following tests: sac.h, sys/ptyvar.h, sys/filio.h, sys/stream.h, gettosbyname(), and make appropriate adjustments in the rest of the .c files. Remove tests which aren't being used anymore: vhangup, utmpx.h, utmp.h, etc. defs.h: Use HAVE_SYS_FILIO_H instead of FILIO_H sys_term.c: Use HAVE_SAC_H and HAVE_SYS_STREAM_H instead of HAS_SAC and STREAMS. telnetd.c, telnetd-ktd.c: Use HAVE_GETTOSBYNAME instead of HAS_GETTOS telnetd.c: Use HAVE_SYS_PTYVAR_H instead of HAS_PTYVAR. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10571 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnetd/ChangeLog | 24 ++++++++++++++++++++++++ src/appl/telnet/telnetd/configure.in | 18 ++---------------- src/appl/telnet/telnetd/defs.h | 2 +- src/appl/telnet/telnetd/sys_term.c | 4 ++-- src/appl/telnet/telnetd/telnetd-ktd.c | 6 +++--- src/appl/telnet/telnetd/telnetd.c | 10 +++++----- 6 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index 4bdfd7311..f71de74f1 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,27 @@ +1998-05-06 Theodore Ts'o + + * telnetd.c (main): + * telnetd-ktd.c (main): POSIX states that getopt returns -1 when it + is done parsing options, not EOF. + +Tue Mar 3 14:26:04 1998 Theodore Ts'o + + * configure.in: Rename HAS_* to HAVE_* for the following tests: + sac.h, sys/ptyvar.h, sys/filio.h, sys/stream.h, + gettosbyname(), and make appropriate adjustments in the + rest of the .c files. Remove tests which aren't being + used anymore: vhangup, utmpx.h, utmp.h, etc. + + * defs.h: Use HAVE_SYS_FILIO_H instead of FILIO_H + + * sys_term.c: Use HAVE_SAC_H and HAVE_SYS_STREAM_H instead of + HAS_SAC and STREAMS. + + * telnetd.c, telnetd-ktd.c: Use HAVE_GETTOSBYNAME instead of + HAS_GETTOS + + * telnetd.c: Use HAVE_SYS_PTYVAR_H instead of HAS_PTYVAR. + Mon Feb 23 22:58:22 1998 Tom Yu * utility.c (ptyflush, netflush): Explicitly reset SIGCHLD handler diff --git a/src/appl/telnet/telnetd/configure.in b/src/appl/telnet/telnetd/configure.in index 84cf4c479..177b119de 100644 --- a/src/appl/telnet/telnetd/configure.in +++ b/src/appl/telnet/telnetd/configure.in @@ -21,9 +21,8 @@ if test -z "$ac_sysv_termio"; then fi fi AC_HEADER_TIME -AC_CHECK_HEADERS(string.h arpa/nameser.h) -AC_CHECK_HEADERS(sys/time.h sys/tty.h) -AC_HAVE_FUNCS(vhangup) +AC_CHECK_HEADERS(string.h arpa/nameser.h sys/time.h sys/tty.h sac.h sys/ptyvar.h sys/filio.h sys/stream.h) +AC_CHECK_FUNCS(gettosbyname) dnl Make our operating system-specific security checks and definitions for dnl login. dnl @@ -41,19 +40,6 @@ esac if test -z "$broken_streams" ; then AC_FUNC_CHECK(grantpt,AC_DEFINE(STREAMSPTY)) fi -AC_HEADER_CHECK(sac.h,AC_DEFINE(HAS_SAC)) -AC_HEADER_CHECK(sys/ptyvar.h,AC_DEFINE(HAS_PTYVAR)) -AC_FUNC_CHECK(gettosbyname,AC_DEFINE(HAS_GETTOS)) -AC_HEADER_CHECK(sys/filio.h,AC_DEFINE(FILIO_H)) -AC_HEADER_CHECK(sys/stream.h,AC_DEFINE(STREAMS)) -AC_HEADER_CHECK(utmpx.h, - AC_DEFINE(UTMPX) - AC_DEFINE(HAVE_UTMPX_H) - ac_utmp_h=1) -if test -z "$ac_utmp_h" ; then -AC_CHECK_HEADERS(utmp.h) -fi -AC_FUNC_CHECK(cgetent,AC_DEFINE(HAS_CGETENT)) AC_MSG_CHECKING([if setpgrp takes two arguments]) dnl AC_CACHE_VAL(krb5_cv_sys_setpgrp_two, diff --git a/src/appl/telnet/telnetd/defs.h b/src/appl/telnet/telnetd/defs.h index 3ce72c6fc..233743179 100644 --- a/src/appl/telnet/telnetd/defs.h +++ b/src/appl/telnet/telnetd/defs.h @@ -89,7 +89,7 @@ # endif #endif -#ifndef FILIO_H +#ifndef HAVE_SYS_FILIO_H #include #else #include diff --git a/src/appl/telnet/telnetd/sys_term.c b/src/appl/telnet/telnetd/sys_term.c index 93a661c1c..282608f8d 100644 --- a/src/appl/telnet/telnetd/sys_term.c +++ b/src/appl/telnet/telnetd/sys_term.c @@ -82,7 +82,7 @@ extern struct sysv sysv; #endif /* NEWINIT */ #ifdef STREAMSPTY -#ifdef HAS_SAC +#ifdef HAVE_SAC_H #include #endif #include @@ -91,7 +91,7 @@ extern struct sysv sysv; #define SCPYN(a, b) (void) strncpy(a, b, sizeof(a)) #define SCMPN(a, b) strncmp(a, b, sizeof(a)) -#ifdef STREAMS +#ifdef HAVE_SYS_STREAM_H #include #endif #ifdef __hpux diff --git a/src/appl/telnet/telnetd/telnetd-ktd.c b/src/appl/telnet/telnetd/telnetd-ktd.c index 6ceb834e8..9ec608fcd 100644 --- a/src/appl/telnet/telnetd/telnetd-ktd.c +++ b/src/appl/telnet/telnetd/telnetd-ktd.c @@ -138,7 +138,7 @@ main(argc, argv) highpty = getnpty(); #endif /* CRAY */ - while ((ch = getopt(argc, argv, "d:a:e:klhnr:u:UI:D:B:sS:a:X:")) != EOF) { + while ((ch = getopt(argc, argv, "d:a:e:klhnr:u:UI:D:B:sS:a:X:")) != -1) { switch(ch) { #ifdef AUTHENTICATION @@ -284,7 +284,7 @@ main(argc, argv) break; #endif /* SecurID */ case 'S': -#ifdef HAS_GETTOS +#ifdef HAVE_GETTOSBYNAME if ((tos = parsetos(optarg, "tcp")) < 0) fprintf(stderr, "%s%s%s\n", "telnetd: Bad TOS argument '", optarg, @@ -433,7 +433,7 @@ main(argc, argv) #if defined(IPPROTO_IP) && defined(IP_TOS) { -# if defined(HAS_GETTOS) +# if defined(HAVE_GETTOSBYNAME) struct tosent *tp; if (tos < 0 && (tp = gettosbyname("telnet", "tcp"))) tos = tp->t_tos; diff --git a/src/appl/telnet/telnetd/telnetd.c b/src/appl/telnet/telnetd/telnetd.c index 983747286..fe594d36d 100644 --- a/src/appl/telnet/telnetd/telnetd.c +++ b/src/appl/telnet/telnetd/telnetd.c @@ -97,7 +97,7 @@ int registerd_host_only = 0; #ifdef HAVE_SYS_TTY_H # include "/usr/include/sys/tty.h" #endif -#ifdef HAS_PTYVAR +#ifdef HAVE_SYS_PTYVAR_H # include #endif @@ -231,7 +231,7 @@ main(argc, argv) highpty = getnpty(); #endif /* CRAY */ - while ((ch = getopt(argc, argv, valid_opts)) != EOF) { + while ((ch = getopt(argc, argv, valid_opts)) != -1) { switch(ch) { #ifdef AUTHENTICATION @@ -404,7 +404,7 @@ main(argc, argv) break; #endif /* SecurID */ case 'S': -#ifdef HAS_GETTOS +#ifdef HAVE_GETTOSBYNAME if ((tos = parsetos(optarg, "tcp")) < 0) fprintf(stderr, "%s%s%s\n", "telnetd: Bad TOS argument '", optarg, @@ -585,7 +585,7 @@ main(argc, argv) #if defined(IPPROTO_IP) && defined(IP_TOS) { -# if defined(HAS_GETTOS) +# if defined(HAVE_GETTOSBYNAME) struct tosent *tp; if (tos < 0 && (tp = gettosbyname("telnet", "tcp"))) tos = tp->t_tos; @@ -641,7 +641,7 @@ usage() #ifdef SecurID fprintf(stderr, " [-s]"); #endif -#ifdef HAS_GETTOS +#ifdef HAVE_GETTOSBYNAME fprintf(stderr, " [-S tos]"); #endif #ifdef AUTHENTICATION -- 2.26.2