From: Ezra Peisach Date: Tue, 30 Jul 1996 02:39:19 +0000 (+0000) Subject: * secure.c: Do not assume sizeof(long) = 4 for sending lengths OTW X-Git-Tag: krb5-1.0-beta7~222 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e06e2c249ce8235d88d2bf37a37633d036533273;p=krb5.git * secure.c: Do not assume sizeof(long) = 4 for sending lengths OTW * configure.in: Determine sizeof short, int, long for secure.c git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8860 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog index 3533bf026..f3426f786 100644 --- a/src/appl/gssftp/ftp/ChangeLog +++ b/src/appl/gssftp/ftp/ChangeLog @@ -1,3 +1,9 @@ +Mon Jul 29 22:37:23 1996 Ezra Peisach + + * secure.c: Do not assume sizeof(long) = 4 for sending lengths OTW + + * configure.in: Determine sizeof short, int, long for secure.c + Fri Jul 26 20:55:12 1996 Sam Hartman * secure.c (secure_putbyte): Reset nout to zero on errorso we diff --git a/src/appl/gssftp/ftp/configure.in b/src/appl/gssftp/ftp/configure.in index 76b7cbee3..40b07852f 100644 --- a/src/appl/gssftp/ftp/configure.in +++ b/src/appl/gssftp/ftp/configure.in @@ -7,6 +7,9 @@ USE_ANAME CHECK_SIGPROCMASK CHECK_WAIT_TYPE DECLARE_SYS_ERRLIST +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) AC_FUNC_VFORK AC_HAVE_FUNCS(getcwd getdtablesize) AC_HEADER_STDARG diff --git a/src/appl/gssftp/ftp/secure.c b/src/appl/gssftp/ftp/secure.c index 6500ed330..183f10a3a 100644 --- a/src/appl/gssftp/ftp/secure.c +++ b/src/appl/gssftp/ftp/secure.c @@ -35,6 +35,18 @@ extern gss_ctx_id_t gcontext; extern char *sys_errlist[]; #endif +#if (SIZEOF_SHORT == 4) +typedef unsigned short ftp_uint32; +typedef short ftp_int32; +#elif (SIZEOF_INT == 4) +typedef unsigned int ftp_uint32; +typedef int ftp_int32; +#elif (SIZEOF_LONG == 4) +typedef unsigned long ftp_uint32; +typedef long ftp_int32; +#endif + + extern struct sockaddr_in hisaddr; extern struct sockaddr_in myaddr; extern int level; @@ -213,8 +225,8 @@ unsigned int nbyte; { static char *outbuf; /* output ciphertext */ static unsigned int bufsize; /* size of outbuf */ - long length; - u_long net_len; + ftp_int32 length; + ftp_uint32 net_len; /* Other auth types go here ... */ #ifdef KERBEROS @@ -295,7 +307,7 @@ int fd; /* number of chars in ucbuf, pointer into ucbuf */ static unsigned int nin, bufp; int kerror; - u_long length; + ftp_uint32 length; if (nin == 0) { if ((kerror = looping_read(fd, &length, sizeof(length)))