* configure.in: Test for speed_t being present
authorEzra Peisach <epeisach@mit.edu>
Fri, 15 Nov 2002 20:21:51 +0000 (20:21 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 15 Nov 2002 20:21:51 +0000 (20:21 +0000)
        * sys_term.c (addarg): When reallocing memory, ensure in size of
        pointer. Use speed_t instead of int for termspeeds.

        * authenc.c, ext.h, state.c, utility.c: Unsigned/signed cleanup.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15012 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/telnet/telnetd/ChangeLog
src/appl/telnet/telnetd/authenc.c
src/appl/telnet/telnetd/configure.in
src/appl/telnet/telnetd/ext.h
src/appl/telnet/telnetd/state.c
src/appl/telnet/telnetd/sys_term.c
src/appl/telnet/telnetd/utility.c

index 11b7b951637aa8e69edbf9860891faf5771a8cc8..64d44c949fe29aeb2915ffc94e4f237a28670ce3 100644 (file)
@@ -1,3 +1,12 @@
+2002-11-15  Ezra Peisach  <epeisach@bu.edu>
+
+       * configure.in: Test for speed_t being present.
+
+       * sys_term.c (addarg): When reallocing memory, ensure in size of
+       pointer. Use speed_t instead of int for termspeeds.
+
+       * authenc.c, ext.h, state.c, utility.c: Unsigned/signed cleanup.
+
 2002-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in: Revert $(S)=>/ change, for Windows support.
index 448895400acab38be21af8b782b5461cbac5cd5e..6d8b04ceded04d6bb1ec8045475b4f43c484d0a4 100644 (file)
@@ -44,7 +44,7 @@ net_write(str, len)
 {
        if (len < 0)
                return 0;
-       return netwrite(str, len);
+       return netwrite(str, (size_t) len);
 }
 
 void
index e64292e59cc84f14d3b9ce01c3abdd13fca93519..7e5780d3a425d4184fd1c04ae27fe3b32a0cea73 100644 (file)
@@ -25,6 +25,30 @@ AC_HEADER_TIME
 AC_CHECK_HEADERS(string.h arpa/nameser.h utmp.h sys/time.h sys/tty.h sac.h sys/ptyvar.h sys/filio.h sys/stream.h sys/utsname.h memory.h)
 AC_CHECK_FUNCS(gettosbyname vsnprintf)
 KRB5_AC_INET6
+dnl
+dnl Test if speed_t needs to be defined
+AC_CACHE_CHECK([if speed_t is defined], krb5_cv_type_speed_t,
+[AC_TRY_COMPILE(dnl
+[#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifndef        USE_TERMIO
+#include <sgtty.h>
+#else
+# ifdef        SYSV_TERMIO
+# include <termio.h>
+# else
+# include <termios.h>
+# endif
+#endif
+],[speed_t termspeed],krb5_cv_type_speed_t=yes, krb5_cv_type_speed_t=no)])
+if test $krb5_cv_type_speed_t = no; then
+   AC_DEFINE(speed_t, int)
+fi;
+dnl
+dnl
 dnl Make our operating system-specific security checks and definitions for
 dnl login.
 dnl
index 445fb9b963f1017957c64c5b4d7b7e5a3a06fe80..9fe38ef8b07d7b06b81d809040a5e0af99217e9e 100644 (file)
@@ -180,7 +180,7 @@ extern void
 extern void netprintf (const char *, ...);
 extern void netprintf_urg (const char *fmt, ...);
 extern void netprintf_noflush (const char *fmt, ...);
-extern int netwrite (const char *, size_t);
+extern int netwrite (const unsigned char *, size_t);
 extern void netputs (const char *);
 
 #ifdef ENCRYPTION
index 104af6943e30ae96d59206daf7896136d8935a3a..b01842f006fb1151c6c306a859f4361b80511c64 100644 (file)
@@ -1633,7 +1633,7 @@ send_status()
        ADD(IAC);
        ADD(SE);
 
-       netwrite(statusbuf, ncp - statusbuf);
+       netwrite(statusbuf, (unsigned) (ncp - statusbuf));
        netflush();     /* Send it on its way */
 
        DIAG(TD_OPTIONS,
index 05b57ffb64ba0ba7832a72d802d6307a6589fb86..bfd1f81afeb8454baaa868526a08a9562c6a534a 100644 (file)
@@ -855,7 +855,7 @@ tty_iscrnl()
  */
 struct termspeeds {
        int     speed;
-       int     value;
+       speed_t value;
 } termspeeds[] = {
        { 0,     B0 },    { 50,    B50 },   { 75,    B75 },
        { 110,   B110 },  { 134,   B134 },  { 150,   B150 },
@@ -1437,7 +1437,7 @@ addarg(argv, val)
        if (cpp == &argv[(long)argv[-1]]) {
                --argv;
                *argv = (char *)((long)(*argv) + 10);
-               argv = (char **)realloc(argv, (long)(*argv) + 2);
+               argv = (char **)realloc(argv, sizeof(*argv) * ((long)(*argv) + 2));
                if (argv == NULL)
                        return(NULL);
                argv++;
index 106dc69e3fdfc25b76bbf155e9aca55c72aac15e..fc8ff7601eb08b489494840d8e15a35b1756dfaf 100644 (file)
@@ -126,7 +126,7 @@ ptyflush()
                DIAG((TD_REPORT | TD_PTYDATA),
                     netprintf("td: ptyflush %d chars\r\n", n));
                DIAG(TD_PTYDATA, printdata("pd", pbackp, n));
-               n = write(pty, pbackp, n);
+               n = write(pty, pbackp, (unsigned) n);
        }
        if (n < 0) {
                if (errno == EWOULDBLOCK || errno == EINTR)
@@ -224,7 +224,7 @@ netclear()
 
     while (nfrontp > thisitem) {
        if (wewant(thisitem)) {
-           int length;
+           unsigned int length;
 
            next = thisitem;
            do {
@@ -273,7 +273,7 @@ netflush()
         * write the entire buffer in non-OOB mode.
         */
        if ((neturg == 0) || (not42 == 0)) {
-           n = write(net, nbackp, n);  /* normal write */
+           n = write(net, nbackp, (unsigned) n);       /* normal write */
        } else {
            n = neturg - nbackp;
            /*
@@ -330,7 +330,7 @@ netflush()
  * Thou shalt not call this with a "%s" format; use netputs instead.
  * We also don't deal with floating point widths in here.
  */
-void
+static void
 netprintf_ext(int noflush, int seturg, const char *fmt, va_list args)
 {
        size_t remain;
@@ -413,7 +413,7 @@ netprintf_noflush(const char *fmt, ...)
  * netflush() if needed.
  */
 int
-netwrite(const char *buf, size_t len)
+netwrite(const unsigned char *buf, size_t len)
 {
        size_t remain;
 
@@ -437,7 +437,7 @@ netwrite(const char *buf, size_t len)
 void
 netputs(const char *s)
 {
-       netwrite(s, strlen(s));
+       netwrite((const unsigned char *) s, strlen(s));
 }
 
 /*
@@ -463,7 +463,7 @@ fatal(f, msg)
                netflush();
        }
 #endif /* ENCRYPTION */
-       (void) write(f, buf, (int)strlen(buf));
+       (void) write(f, buf, strlen(buf));
        sleep(1);       /*XXX*/
        exit(1);
 }
@@ -693,7 +693,7 @@ printsub(direction, pointer, length)
            switch (pointer[1]) {
            case TELQUAL_IS:
                netputs("IS \"");
-               netwrite((char *)pointer + 2, (size_t)(length - 2));
+               netwrite(pointer + 2, (size_t)(length - 2));
                netputs("\"");
                break;
            case TELQUAL_SEND:
@@ -713,7 +713,7 @@ printsub(direction, pointer, length)
            switch (pointer[1]) {
            case TELQUAL_IS:
                netputs("IS ");
-               netwrite((char *)pointer + 2, (size_t)(length - 2));
+               netwrite(pointer + 2, (size_t)(length - 2));
                break;
            default:
                if (pointer[1] == 1)
@@ -962,7 +962,7 @@ do {                                                \
            switch (pointer[1]) {
            case TELQUAL_IS:
                netputs("IS \"");
-               netwrite((char *)pointer + 2, (size_t)(length - 2));
+               netwrite(pointer + 2, (size_t)(length - 2));
                netputs("\"");
                break;
            case TELQUAL_SEND:
@@ -1063,7 +1063,8 @@ do {                                              \
                netputs(((pointer[3] & AUTH_ENCRYPT_MASK) == AUTH_ENCRYPT_ON)
                        ? "|ENCRYPT" : "");
 
-               auth_printsub(&pointer[1], length - 1, buf, sizeof(buf));
+               auth_printsub(&pointer[1], length - 1, (unsigned char *)buf, 
+                             sizeof(buf));
                netputs(buf);
                break;
 
@@ -1150,7 +1151,8 @@ do {                                              \
                    netprintf("%d (unknown)", pointer[2]);
                netputs(" ");
 
-               encrypt_printsub(&pointer[1], length - 1, buf, sizeof(buf));
+               encrypt_printsub(&pointer[1], length - 1, 
+                                (unsigned char *) buf, sizeof(buf));
                netputs(buf);
                break;